| c# queries slower than java? -
06-04-2007, 07:48 AM
Hi,
I have been accessing mysql via java and am now trying to use c#
instead. I am using the .Net connector that I downloaded from
mySQl.org. However, it seems much slower in selects than the jobdc
driver. For example, a selection of 200,000 rows took me 8 seconds in
c# compared to 2 seconds in java. Is there some other approach I
should be using?
I am using the following code in c#:
using MySql.Data.MySqlClient;
string connStr = "server=***;user id=***; p***word=***; database=***;
pooling=false";
try
{
DataTable data = new DataTable();
MySqlConnection conn = new MySqlConnection(connStr);
conn.Open();
MySqlDataAdapter da = new
MySqlDataAdapter("SELECT * FROM table1 where x<200000", conn);
da.Fill(data);
} |