Bug #5565 MySqlDataAdapter fills null values into DataTable
Submitted: 14 Sep 2004 9:10 Modified: 16 Sep 2004 12:44
Reporter: Guy Platt Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:Beta 1.0.0 OS:Windows (XP SP2)
Assigned to: Assigned Account CPU Architecture:Any

[14 Sep 2004 9:10] Guy Platt
Description:
The following statement produces a DataTable which contains the first column but then either correct values or null values for the other two columns.

MySqlDataAdapter employeeAdapter = new MySqlDataAdapter	(
					"SELECT IdAgent, ContactPerson, Email FROM ppmr_agents WHERE Employee = 1 ORDER BY idAgent" , MyConn);
													
DataTable employeeTable =  new DataTable();
employeeAdapter.Fill(employeeTable);

When the same statement is executed with ByteFX 0.76 it works perfectly.

Occassionaly the statement works as desired, however it appears random as too when it works.  Typically the first few rows returned are correct, then once null values are returned they are always returned.

How to repeat:

Create a table called ppmr_agents (mine has approximately 100 records). idAgent is int 10, ContactPerson is varchar 50, email varchar 50, employee is int 1.

MySqlConnection MyConn;
				MyConn = new MySqlConnection(connectionString);

				MySqlDataAdapter employeeAdapter = new MySqlDataAdapter	(
					"SELECT IdAgent, ContactPerson, Email FROM ppmr_agents WHERE Employee = 1 ORDER BY idAgent" , MyConn);
													
				DataTable employeeTable =  new DataTable();
				employeeAdapter.Fill(employeeTable);

				DataColumn[]  errPKeyCol = new DataColumn[1];
				errPKeyCol[0] = employeeTable.Columns["IdAgent"];
				employeeTable.PrimaryKey = errPKeyCol;
[14 Sep 2004 16:15] James Moore
I wonder if this has anything to do with the bug about nulls I just submitted (#5571)?
[16 Sep 2004 12:44] Reggie Burnett
I am quite certain this is a duplicate of bug# 5388 which has already been fixed.  If after beta 2 is released you still have problems, please reopen this bug.
[13 Oct 2004 0:04] henry eli
I am still gettting this error in the latest version out as of 10/12/2004
[23 Apr 2007 14:32] Lee Baron
fdsfsdf

Attachment: sql statements.txt (text/plain), 1.38 KiB.