Hi !
I try to read some data from my database (5.5). And I used two variants:
DataReader and DataSet.
This is the code I used:
DataReader:
conn = new MySqlConnection(cs);
conn.Open();
string stm = "SELECT * FROM data1 ORDER BY ID DESC LIMIT 2";
MySqlCommand cmd = new MySqlCommand(stm, conn);
rdr = cmd.ExecuteReader();
DataSet:
string stm = "SELECT * FROM data1 ORDER BY ID DESC LIMIT 2";
conn = new MySqlConnection(cs);
conn.Open();
ds = new DataSet();
da = new MySqlDataAdapter(stm, conn);
da.Fill(ds, "data");
I measured the time for the Code parts above and I got this results:
1) DataReader
LIMIT = 2 ~ 226 ms
LIMIT = 2560 ~ 218 ms
2) DataSet
LIMIT = 2 ~ 204 ms
LIMIT = 2560 ~ 280 ms
The server is local running.
So why are there always ~200ms of time wasting?
Any help would appreciated.
Dominik
I try to read some data from my database (5.5). And I used two variants:
DataReader and DataSet.
This is the code I used:
DataReader:
conn = new MySqlConnection(cs);
conn.Open();
string stm = "SELECT * FROM data1 ORDER BY ID DESC LIMIT 2";
MySqlCommand cmd = new MySqlCommand(stm, conn);
rdr = cmd.ExecuteReader();
DataSet:
string stm = "SELECT * FROM data1 ORDER BY ID DESC LIMIT 2";
conn = new MySqlConnection(cs);
conn.Open();
ds = new DataSet();
da = new MySqlDataAdapter(stm, conn);
da.Fill(ds, "data");
I measured the time for the Code parts above and I got this results:
1) DataReader
LIMIT = 2 ~ 226 ms
LIMIT = 2560 ~ 218 ms
2) DataSet
LIMIT = 2 ~ 204 ms
LIMIT = 2560 ~ 280 ms
The server is local running.
So why are there always ~200ms of time wasting?
Any help would appreciated.
Dominik