BlackByte
Well-known member
Hi im using vs 2005, i have learnt how connect to a database using code in vb.net, i would like to know how to use a database that was added to the project(copy and paste), i want to display the data in it. thanx
Hi thanks for the quick reply, and sorry abt my unclear question, i wanted to know how to get data from a database added as a data source, i tried using ds.tables(0).rows(0).item, but i get an error saying there's no row at position 0.
.
[COLOR="blue"]If [/COLOR]ds.Tables(0).Rows.Count > 0 [COLOR="Blue"]Then[/COLOR]
TextBox1.Text = ds.Tables(0).Rows(0)([COLOR="Red"]"ColumnNameHere"[/COLOR])
[COLOR="blue"]Else[/COLOR]
TextBox1.Text = ""
MsgBox([COLOR="red"]"Table : "[/COLOR] & ds.Tables(0).TableName.ToString _
& vbCrLf _
& [COLOR="red"]"Record Count : " [/COLOR]& ds.Tables(0).Rows.Count.ToString)
[COLOR="blue"]End If[/COLOR]