Are you sure there are items returned? Are there any exceptions thrown?
Btw, I'm assuming you know that the SQL code you posted is susceptible to
SQL injection attack. I hope you just did that to show the code and isn't
the actual code.
--
Eric Cherng
MCP, MCDBA, MCSD
http://echerng.com
"Michael Persaud" <> wrote in message
news:...
> Hi All,
> I am trying to write the contents of a dataset to variables that i have
> declared as string types.
>
> I cannot seem to get it right to assign the field values to the variables
>
> Pls Help
> Thanks
> MP
>
> Sub getuserDetails()
> Dim str As String = "Select Address,City,Telephone,Alternatetele
> from ContactDetails where userid=" & LabelUserID.Text
> Dim cmdText As New SqlCommand(str, Conn)
> Dim ds As New DataSet
> Dim da As SqlDataAdapter = New SqlDataAdapter(cmdText)
> Conn.Open()
> da.Fill(ds, "ContactDetails")
>
> Conn.Close()
>
> UAddress = ds.Tables("ContactDetails").Rows(1).Item(0).ToStri ng
>
> UCity = ds.Tables("ContactDetails").Rows(1).Item(0).ToStri ng
> ..............................
>
>