| re: Need help with code
I believe it is the Item property of the Rows collections, not Column.
It is also the default indexer, so it can be omitted:
dtCMDetail("CreateDate").Rows(Index).Item("CreateD ate").tostring
or
dtCMDetail("CreateDate").Rows(Index)("CreateDate") .tostring
Greg
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:e5K%23y8%23pEHA.376@TK2MSFTNGP14.phx.gbl...[color=blue][color=green]
>> lblCreateDate.Text = dtCMDetail("CreateDate").ToString() 'error on this[/color]
> line[color=green]
>> during compilation[/color]
>
> You need to specify the row and column name
>
> lblCreateDate.Text =
> dtCMDetail("CreateDate").Rows(Index).Column("Creat eDate").tostring 'error
> on this line
>
>
> --
>
> OHM ( Terry Burns )
> . . . One-Handed-Man . . .
>
> Use the following to email me
>
> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Button1.Click
>
> Debug.WriteLine(ob("ufssz/cvsotAhsfbuTpmvujpotXjui/OFU", False))
>
> End Sub
>
> Private Function ob(ByVal email As String, ByVal inc As Boolean) As
> String
>
> Dim ch() As Char
> Dim i As Int32
> Dim stepValue As Int16
>
> If inc Then stepValue = 1 Else stepValue = -1
>
> ch = email.ToCharArray()
>
> For i = 0 To ch.Length - 1
> ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) + stepValue)
> Next
>
> Return New String(ch)
>
> End Function
>
>
> Time flies when you don't know what you're doing
>
> "Ed Chiu" <EdChiu@discussions.microsoft.com> wrote in message
> news:20D73039-EEF0-4031-A6C8-C12F6CE44C6F@microsoft.com...[color=green]
>> Hi,
>>
>> I have a Dataset named dsCMDetail, there is only one data table in the
>> dataset, the following code snippet does not compile:
>>
>> Dim dtCMDetail as datatable
>> dtCMDetail = dsCMDetail.table(0)
>> lblCreateDate.Text = dtCMDetail("CreateDate").ToString() 'error on this[/color]
> line[color=green]
>> during compilation
>>
>> Error messge: Class 'System.Data.Datatable' cannot be indexed because it[/color]
> has[color=green]
>> no default property
>>
>> What should I do?
>>
>> Thanks in Advance
>>
>>[/color]
>
>[/color] |