M
Michael Persaud
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).ToString
UCity = ds.Tables("ContactDetails").Rows(1).Item(0).ToString
...............................
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).ToString
UCity = ds.Tables("ContactDetails").Rows(1).Item(0).ToString
...............................