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
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