Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
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
 
Old April 26th, 2004, 03:11 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default 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.
 
Old April 26th, 2004, 03:23 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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?

 
Old April 28th, 2004, 05:45 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

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.
 
Old April 28th, 2004, 06:07 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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?

 
Old April 28th, 2004, 06:56 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

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.
 
Old April 28th, 2004, 07:10 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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?

 
Old April 28th, 2004, 07:58 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

Sure I can! I just wonted to ask for better way.
Ok im going with that!

Always:),
Hovik Melkomian.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Dataset & Stored Procedure Problem clioz BOOK: Professional Crystal Reports for VS.NET 0 July 21st, 2006 07:42 PM
idea of report & DataSet melvik Crystal Reports 1 May 18th, 2004 02:10 AM
SqlCommand & DataSet melvik ADO.NET 4 April 5th, 2004 11:50 AM
update table (SQL & DataSet) melvik ADO.NET 1 July 24th, 2003 04:40 PM
Command & DataSet melvik ADO.NET 2 July 3rd, 2003 01:32 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.