471,350 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,350 software developers and data experts.

Performance reading records with .Net 2.0

Hello Newsgroup,

the following Code reads 60.000 records from an Access Datatable:

static void Main(string[] args)
{
String connString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\test.mdb";
OleDbConnection conn = new OleDbConnection(connString);
conn.Open();
OleDbCommand cmd = new OleDbCommand("select * from TAB_SCHADEN",
conn);
OleDbDataAdapter adap = new OleDbDataAdapter(cmd);
DataSet dataSet = new DataSet();
MessageBox.Show(DateTime.Now.ToLongTimeString());
adap.Fill(dataSet);
MessageBox.Show(DateTime.Now.ToLongTimeString());
conn.Close();
}

With .Net1.1 this takes 15 seconds. with .Net 2.0 it takes 3 minutes.
Anyone got the same experience. Anyone an idea how to get it faster
with .Net 2.0?
Thanks and Regards
Hagen

Feb 24 '06 #1
4 1257
Well, are you just trying to read the records, or do you absolutely need the
dataset object? If the former, then you could switch to using a DataReader
instead, so you will impose far less overhead on the client (not having to
parse the data into a complex structure nor hold it all in memory at once).

Marc
Feb 24 '06 #2
Hi Marc,

I tried using a DataReader but this didn't change a lot. It took about
2,5 minutes.

For my application I want to use a dataadapter und I want to use .NET
2.0. But why is it so slow reading the data. Am I missing something?

Hagen

Feb 24 '06 #3
Can you try using typed datase datatable and tableadpter ?
i think it will really increase the performance
"Hagen Rehr" <ha********@gmx.de> ha scritto nel messaggio
news:11**********************@e56g2000cwe.googlegr oups.com...
Hello Newsgroup,

the following Code reads 60.000 records from an Access Datatable:

static void Main(string[] args)
{
String connString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\test.mdb";
OleDbConnection conn = new OleDbConnection(connString);
conn.Open();
OleDbCommand cmd = new OleDbCommand("select * from TAB_SCHADEN",
conn);
OleDbDataAdapter adap = new OleDbDataAdapter(cmd);
DataSet dataSet = new DataSet();
MessageBox.Show(DateTime.Now.ToLongTimeString());
adap.Fill(dataSet);
MessageBox.Show(DateTime.Now.ToLongTimeString());
conn.Close();
}

With .Net1.1 this takes 15 seconds. with .Net 2.0 it takes 3 minutes.
Anyone got the same experience. Anyone an idea how to get it faster
with .Net 2.0?
Thanks and Regards
Hagen
Feb 24 '06 #4
I tried a typed datatable and tableadpter. This didn't change anything.
I heard, that is a problem with the .Net 2.0 DataAccess...

Feb 27 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Randell D. | last post: by
5 posts views Thread by Scott | last post: by
13 posts views Thread by bjarne | last post: by
9 posts views Thread by Jurgen | last post: by
15 posts views Thread by MuZZy | last post: by
5 posts views Thread by Bob Alston | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.