You can have three connections which would work. You can only traverse
forward with a DataReader. On the other hand, it sounds like you probably
want to sit all three queries in DataTables in a DataSet and use a
DataRelation to relate them if applicable.
Record size is also a big consderation. If you are talking about 1000
records, you probably will hardly be able to notice the performance
difference on most machiens. However, this depends on Table szie. but the
larger your query, the more pronounced the performance difference. Just
yesterday I was benchmarking queries and for pull 186,000 records from a
given table, it took almost half a minute with a DataAdapter. Using a
Reader it took just under 12 seconds. .
Also, joining tables server side in a query probably isn't the way to go.
You can use a datarelation object to relate tables and then you don't have
to pull over as much data. The differences here can be profound as well.
Hopefully this helps.
Bill
"lakshmi" <lm@replytonewsgroup.net> wrote in message
news:07****************************@phx.gbl...
Hi all,
My requirement is I need to have three different
recordsets open at the same time. Traversing through the 3
recordsets, I would check on the data and based on some
rules, return an object from my function.
Will it be efficient to use a SQLDataReader or a DataSet
for this situation? I understand from the documentation
that there can be only one SQLDataReader associated with a
connection open at a time. So, it seems like I can't have
3 SqlDataReaders open at the same time for my connection.
is SqlDataReader usable for these type of conditions
(unless I combine my 3 recordsets into a single recordset
by some means?)
Or can a DataSet be used? But I wouldn't be doing any
updates or deletes to any of those recordsets? Is it
useful to use a dataset at all?
I'm a beginner in C# and ADO.NET. Thanks for all your help.