SELECT Queries

SELECT Queries

Postby dracoaroch » Sun 14 Oct 2007 09:46

Hello!

I am currently working on a custom DTS package through .NET from MySQL to MSSQL. I have created some queries that are supposed to pull back all results from certain tables and dump those results into the corresponding tables in MSSQL. The problem is, on some tables, I am only getting back 1870 rows, when there are in fact a lot more. Other tables, I get back the full amount.

By simple queries I mean something as simple as:

SELECT * from users

the record count of the returned object is 1870, when in fact there are 1944 in this instance.

If I run this same query directly in MySQL it pulls the expected results.

I am using an object of type MySqlCommand to open an object of type MySqlTable like this:


Code: Select all
MySqlConnection mysql = new MySqlConnection(connStr);
string query="SELECT * FROM users";
mysql.Open();
MySqlCommand cmd = new MySqlCommand(query.ToString());
MySqlDataTable rs = new MySqlDataTable(cmd, mysql);
MessageBox.Show(rs.RecordCount.ToString());  //result is 1870 - result from MySQL query analyzer is 1944


Mind you the actual queries are not nearly as simple as the one above. I simplified it down to see if the query itself was the culprit.

Is there something I am doing wrong? I cannot use the objects to dynamically build the statement, as the statement will be imported from another location so the DTS package is modifiable.

If there is another way to run a query as a string that returns the right record count, please advise.

Thanks in advance
dracoaroch
 
Posts: 1
Joined: Sun 14 Oct 2007 09:34

Postby Alexey » Mon 15 Oct 2007 08:01

Do you somehow adjust such MySqlDataTable's properties as QueryRecordCount or FetchAll?
Could you send me your project including the definition of your own database objects?
(Use e-mail address provided in the Readme file.)
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43


Return to dotConnect for MySQL