Question for DataSet

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

In RecordSet, there is EOF. But, there is no EOF in
DataSet. There is only EOF in XMLReader. I use
sqlDataAdapter and DataSet to retreive data from DB. I
need to know whether it is the end of the file. How should
I do it?

How to get data from DB and store to local variables and
Vector?

I use select * from table SQL statement to retrieve the
data from DB. I can use setMethod to set the data to local
variable. In Java, I use Vector and while loop to store
object data. How can I do it in C#?

Moreover, in recordset, each row of table is one
recordset. I can delete, update, close or movenext. But,
how can I do these functions in dataset?

Thanks for help.
 
If you want to run to EOF, you have to use a DataReader

Do While dr.Read()
Next

Of course, the .NET model is more databinding driven, so binding is a better
option, in most cases. If you are set on doing this in the DataSet, you can
check current row number against total number of rows.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 
Apologies. Thought I was in VB.NET group:

while (dr.Read())
{
}

for DataReader. For DataSet, you can check current row against number of
rows in the table:

DataSetName.DataTables(0).Rows.Count;

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 
Back
Top