General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old April 16th, 2003, 12:15 PM
thomaskeegan thomaskeegan is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 15 thomaskeegan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
SqlDataAdapter .Fill() can ya...


string m_sSelect = "SELECT Firstname, Secondname, [House Name], [House No], Street, Area, Postcode FROM VOTERSREGISTER WHERE [Postcode] = 'DUBLIN 6W'";

int m_nCurrentRow = 0;
...
...
...

public bool Read(ref DataSet ds)
{
SqlDataAdapter m_sda = new SqlDataAdapter(m_sSelect, m_sqlcConn);

ds.Clear();
try
{
m_sda.Fill(ds, m_nCurrentRow, 100, "VotingRegister");
}
catch(ERROR BLA DI BLA....)
{
return false;
}

if(0 == ds.Tables["VotingRegister"].Rows.Count)
return false;

m_nCurrentRow += 100;

return true;
}


This is the my code.

Now my problem is that I am using a DataSet to hold the return data and I place that data in a Table called VotingRegister. I feel thats a bit of a waste. Is there anyway that just insert the data into a DataTable? Also see the way I pull in 100 rows at a time. Is it possible to do the same with .Fill() if you use a DataTable? As I'm expect over 5000 records to be returned if I didn't do it in steps.

help please!

Reply With Quote
  #2  
Old April 17th, 2003, 03:58 AM
thomaskeegan thomaskeegan is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 15 thomaskeegan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I gather some people are gonna suggest I use...

[C#]
protected virtual int Fill(
DataTable dataTable,
IDbCommand command,
CommandBehavior behavior
);

but what I don't understand is how do you get it to read in 100 rows at a time. Say If I have 1000 rows in a database. I only want 100 at a time. I read in the first 100, I read in the second 100 but need to read from row 200. how you do that?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > SqlDataAdapter .Fill() can ya...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway