 |
| ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application . |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

April 26th, 2004, 03:11 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
|
|
DataSet & data
Dear frinds:
After working with DataAdapter & DataSet I got its a client-side DataSet! And I didnt find any property for Server side & ...
Is it fixed to Client-Side?! How can I change it! I need Server side DataSet!
Thanks in advance.
Always:),
Hovik Melkomian.
__________________
Always,
Hovik Melkomian.
|
|

April 26th, 2004, 03:23 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi Hovik,
What do you mean with a client side / server side dataset? Are you referring to the "cursor type" from classic ADO?
A DataSet is a disconnected object (that is, it does not need an open connection to the datasource to function), so AFAIK, it's always a "client side" object.
What do you need a server side dataset for? A DataReader might be suitable for that. Can you elaborate a bit what you need?
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Megalomania by Muse (Track 15 from the album: Hullabaloo) What's This?
|
|

April 28th, 2004, 05:45 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
|
|
Imar: tnx for ur reply.
Imagin I have a table with 100,000 records. as u know if I wanna fill my DataSet it takes too much [u](bc it a Cleint side, [u]refering to classic ADO</u>)</u>.
Its my problem! can u help me, what to do?!
Always:),
Hovik Melkomian.
|
|

April 28th, 2004, 06:07 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi Hovik,
With such a large table, getting all the data in a DataSet is indeed not a wise decision. With a Server Side cursor in classic ADO, you could still connect to the table, and only retrieve the records you actually needed.
I think the disconnected .NET world asks for a different approach. With such a large table, you are probably better of using a stored procedure that only retrieves the number of records you want to display on your page (I assume you're using paging to present the data. Dumping 100,000 records on a page isn't going to be much fun).
I suggest you read the following articles about "custom paging". The last one is aimed at classic ASP, but the principle with the stored procedures applies to .NET as well.
http://www.dotnetjunkies.com/Tutoria...BDB9B8845.dcik
http://www.4guysfromrolla.com/webtech/062899-1.shtml
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: New York City Cops by The Strokes (From the album: Is This It) What's This?
|
|

April 28th, 2004, 06:56 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
|
|
Ok Imar tnx for response.
I know how to work that way. But I wonder is it the only way?!
Tnx in advance.
Always:),
Hovik Melkomian.
|
|

April 28th, 2004, 07:10 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hmmm, I think so. I think it's an either/or situation. Either you retrieve all the records, or you don't.
If you don't retrieve all the records, you'll need a mechanism that is able to retrieve just the subset you actually need. I can only think of stored procedures to do that, but I might be overlooking something.
The DataReader is the closest to a Server Side cursor, as it works over a live and connected connection. I am not sure, but maybe the Read() method doesn't actually retrieve the records as long as you don't use one of its Get* methods. But still, I think looping 99,990 times to get just the last 10 record is not going to be really fast.
Why do you need a different solution? Can't you use Stored Procedures in your project?
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Montego Bay Spleen by St Germain (Track 2 from the album: Tourist) What's This?
|
|

April 28th, 2004, 07:58 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
|
|
Sure I can! I just wonted to ask for better way.
Ok im going with that!
Always:),
Hovik Melkomian.
|
|
 |