i think, i have found a bug in the dotConnect for Postgres Version 6.1.58.0
I tried to get the sample code running from the page:
http://www.devart.com/dotconnect/postgr ... #pureasync
I want to get the data of a table with 1,000,000 test records via the async mode.
My Code:
Code: Select all
void UseDataTable(PgSqlDataTable myDataTable, PgSqlConnection myConnection)
{
myDataTable.Connection = myConnection;
myDataTable.SelectCommand = myConnection.CreateCommand();
myDataTable.SelectCommand.CommandText = "SELECT * FROM test";
myDataTable.NonBlocking = true;
IAsyncResult aRes = myDataTable.BeginFill(null, null);
//when process is here all data has already been loaded...
Console.Write("Fetch in process");
Thread.Sleep(100);
myDataTable.SuspendFill(true);
Console.Write("Fetch is stopped");
myDataTable.EndFill(aRes);
Console.Write("All records are fetched");
}
But the beginfill() always gets all data. (it doesnt jumps back).
so I tried the following same for dotConnect Mysql
Code: Select all
void UseDataTable(MySqlDataTable myDataTable, MySqlConnection myConnection)
{
dataGridView1.AutoGenerateColumns = true;
myDataTable.Connection = myConnection;
myDataTable.SelectCommand = myConnection.CreateCommand();
myDataTable.SelectCommand.CommandText = "SELECT * FROM test";
IAsyncResult aRes = myDataTable.BeginFill(null, null);
Console.Write("Fetch in process");
// Thread.Sleep(100);
// myDataTable.SuspendFill(true);
// Console.Write("Fetch is stopped");
// myDataTable.EndFill(aRes);
// Console.Write("All records are fetched");
}
So bug or something else ?
P.S.
the SQLs:
Postgres:
Code: Select all
-- DROP TABLE test;
CREATE TABLE test
(
pid serial NOT NULL,
text1 character varying(100),
text2 character varying(200),
text3 text,
int1 integer,
CONSTRAINT test_pkey PRIMARY KEY (pid )
)
WITH (
OIDS=FALSE
);
ALTER TABLE test
OWNER TO postgres;
Code: Select all
CREATE TABLE `test` (
`idtest` int(11) NOT NULL AUTO_INCREMENT,
`text1` varchar(100) DEFAULT NULL,
`text2` varchar(200) DEFAULT NULL,
`text3` text,
`intX` int(11) DEFAULT NULL,
PRIMARY KEY (`idtest`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1