T
Thomas P.
Hi,
I used VB.NET 2003 to read data from a SqlCe database and show it in a
DataGrid.
Now I am looking for a method which returns an integer value with the
total number of rows and/or colums to me.
Dim cn As SqlCeConnection
cn = New SqlCeConnection("Data Source = \My
Documents\Test.sdf;Password=")
cn.Open()
Dim cmd As SqlCeCommand = cn.CreateCommand
cmd.CommandText = "Select numbers From Test"
Dim da As New SqlCeDataAdapter(cmd)
Dim ds As New DataSet
da.Fill(ds)
DataGrid1.Enabled = False
DataGrid1.DataSource = ds.Tables(0)
I need to know how many rows the DataGrid1 has because I want to use a
loop to go through the DataGrid.
With the following code I plan to read some datas.
ds.Tables(0).Rows(0)(0)
I am a newbee in VB.Net so please try to explain it with simple words
and some code samples to me. Thans a lot.
Regards,
Thomas Peterson
I used VB.NET 2003 to read data from a SqlCe database and show it in a
DataGrid.
Now I am looking for a method which returns an integer value with the
total number of rows and/or colums to me.
Dim cn As SqlCeConnection
cn = New SqlCeConnection("Data Source = \My
Documents\Test.sdf;Password=")
cn.Open()
Dim cmd As SqlCeCommand = cn.CreateCommand
cmd.CommandText = "Select numbers From Test"
Dim da As New SqlCeDataAdapter(cmd)
Dim ds As New DataSet
da.Fill(ds)
DataGrid1.Enabled = False
DataGrid1.DataSource = ds.Tables(0)
I need to know how many rows the DataGrid1 has because I want to use a
loop to go through the DataGrid.
With the following code I plan to read some datas.
ds.Tables(0).Rows(0)(0)
I am a newbee in VB.Net so please try to explain it with simple words
and some code samples to me. Thans a lot.
Regards,
Thomas Peterson