|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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! |
|
#2
|
|||
|
|||
|
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? |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > SqlDataAdapter .Fill() can ya... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|