Reputation: 2093
This is the code I have:
Sub Main()
Dim dts As New DataSet
Dim da As New SqlDataAdapter
Dim SolTabla As New DataTable
Dim Columna As New DataColumn
Cnx As New SqlConnection("Some Connection String")
Dim vsql2 = "SELECT * FROM Table1 where code = '" & value & "'"
da = New SqlDataAdapter(vsql2, Cnx)
da.Fill(dts, "SomeTable")
SolTabla = dts.Tables(0)
Columna = SolTabla.Columns(0)
......
End Sub
For example, I want to access the second cell value in "Columna". How can I do this with no using a Datagrid?
Upvotes: 3
Views: 9984
Reputation: 6453
Rows and Columns are indexed starting from zero, so the second row would be indexed as 1:
SolTabla.Rows(1)(Columna)
Upvotes: 4