|
-
Feb 15th, 2005, 07:27 AM
#1
Thread Starter
New Member
How to display a value field from a record
Hello,
I am a newbie and need help in displaying a value from the record in mobile asp.net form. I tried using this line ImagePath = objDataSet.Tables.Rows(0).Item("Image") but there seem to be an error that reads " 'Rows' is not a member of ' System.Data.DataTableCollection ' ". Here is the full code :
Dim strSQL As String = "SELECT Image " & _
"FROM Map " & _
"WHERE Image_ID LIKE '" & Session("SSroad") & "'" & _
"ORDER BY Image_ID"
'Create data objects
Dim objConn As New SqlConnection(strConn)
Dim objCmd = New SqlCommand(strSQL, objConn)
Dim objDataSet As DataSet = New DataSet
Dim objDataAdapter As New SqlDataAdapter(objCmd)
objDataAdapter.Fill(objDataSet)
ImagePath = objDataSet.Tables.Rows(0).Item("Image")
Appreciate the help.
-
Feb 17th, 2005, 05:09 AM
#2
Fanatic Member
Re: How to display a value field from a record
ImagePath = objDataSet.Tables(0).Rows(0).Item("Image")
-
Feb 19th, 2005, 02:07 PM
#3
Thread Starter
New Member
Re: How to display a value field from a record
I tried using that method but it seems to display nothing. By using this code i was able to display the data that i want which is the path.
ImageList.DataSource = objDataSet.Tables("Map").DefaultView
ImageList.DataValueField = "Image"
ImageList.DataTextField = "Image"
ImageList.DataBind()
How do i display assign the value to Dim As ImagePath As String. Appreciate the response
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|