473,386 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Question for DataSet

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.
Nov 15 '05 #1
2 2293
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!
************************************************** ********************
"Tom" <ke*****@yahoo.com> wrote in message
news:07****************************@phx.gbl...
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.

Nov 15 '05 #2
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!
************************************************** ********************
"Tom" <ke*****@yahoo.com> wrote in message
news:07****************************@phx.gbl...
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.

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Simon Harvey | last post by:
Hi everyone, I was wondering if it is possible, to use SQL to return more than one table at a time into a dataset. I only know the basics of SQL and so I'm not sure if I'm just asking a stupid...
2
by: JS | last post by:
I'm trying to create a data layer and having problems returning a DataSet from my code that's in a class module. Please forgive me. I'm new to C# (VB'er). I decided to create my data layer in...
1
by: Mike Malter | last post by:
I am just starting to work with reflection and I want to create a log that saves relevant information if a method call fails so I can call that method again later using reflection. I am...
1
by: PCC | last post by:
I am writing a data access layer for a web service. Data from the web service is to be returned as XML. My design dilemma is this... Should I be returning XML from my stored procedures using...
2
by: Simon Harvey | last post by:
Hi everyone, I was wondering if it is possible, to use SQL to return more than one table at a time into a dataset. I only know the basics of SQL and so I'm not sure if I'm just asking a stupid...
0
by: Mike | last post by:
Hi, I am trying to solve a problem with a DataSet issue I am having. In my app the user selects certain options and based on those options it goes out to the db to get data based on those...
6
by: rodchar | last post by:
Hey all, I'm trying to understand Master/Detail concepts in VB.NET. If I do a data adapter fill for both customer and orders from Northwind where should that dataset live? What client is...
1
by: Kevin S. Goff | last post by:
Hi, all, Hopefully this will make sense: I have 2 classes that implement the same generic interface. public interface IAgingReport<T> { T GetAgingReport(DateTime dAsOfDate); }
0
by: | last post by:
I have a question about spawning and displaying subordinate list controls within a list control. I'm also interested in feedback about the design of my search application. Lots of code is at the...
15
by: Andrew Meador | last post by:
I am working on an application that will store data in SQL Server 2005 Express. The database will reside on our server at the office. I need to write an application that can work with this data off...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.