Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Next, Previous, Last, First in ADO.NET

Status
Not open for further replies.

mark1110

Programmer
Apr 20, 2005
85
US
I am rewriting a VB6 application that is using ADO to C# using ADO.NET. What I would like to do seems simple enough, I have a form with several textboxes, comboboxes, and checkboxes. I would like to open a Access database, read its contents, then populate the form. I also need to go to the next record, go to the previous record etc. Here is part of the code I wrote:


private void frmClient_Load(object sender, EventArgs e)
{

OleDbDataAdapter daClient;
DataTable dtClient;
string strClientSQL;



string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data source= " + Utilities.stdDir;
strClientSQL = "SELECT * FROM Client ORDER BY casename";
daClient = new OleDbDataAdapter(strClientSQL,Utilities.connectionString);
dtClient = new DataTable("ClientInfo");
daClient.Fill(dtClient);


This works, however since I have over 500,000 records it takes 10 minutes to load. I am not sure if this is correct way to do this. Is there a better way?

Thanks,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top