How To Get Number Of Rows or Column

akkate86ygk

New member
Joined
Apr 26, 2008
Messages
2
Programming Experience
Beginner
I'm using SqlDataAdapter and DataSet

Q1:
Can anyone tell me how to get the count of table, count of rows, and count of column?

Q2:
dataSet.Table(0).rows(0).item(0)
will get the data of the 1st table, 1st row, and 1st column?

Q3:
How if I do not want to get the data by using number, I want to get the data by using table name, column name?

Please provide me some sample code if possible.
I'm beginner in vb.net.
Thank you.
 
Q2 : Yes
Q3 : Enumeration is the only way I know. I've switched to using LINQ, which allows you to reference them by name. Actually, it treats everything as an object, so it'll look something like :
VB.NET:
Dim db as DBLINQDataContext
Dim dbObj as TableName = New TableName
dbObj = From Whatever in db.TableName Where Whatever.Column1 = Something Select Whatever
dbObj.Column2 = SomethingElse
dbObj.Column3 = SomethingElseElse
db.SubmitChanges()

Of course, this is a very simplistic example, but there's really no more underlying code than that once you've setup your project to handle LINQ (which is pretty simple, as well)
 
Back
Top