Thanks for letting me know how to do this. It was quick and easy to build.
I did discover a bug in the way that an empty string is handled by the
DataReader .. will go search the MySql bugs now to see whether it has
been reported. Basically an empty string is being returned as an
<undefined value> which then causes a crash when I try and assign it to
a string value.
Barry Zubel said the following wise words on 2004-09-28 4:33 PM:
> Ok, I checked bugs.mysql.net and it does appear to have been found,
> and the bug in question trampled into a million pieces.
> I bk'ed the main source tree, compiled, tested, and it works like a
> Still looking forward to Beta 2 though! ;)
> -------- Original Message --------
> Subject: Odd ?bug? with DBNull Values
> Date: Tue, 28 Sep 2004 15:08:07 +0100
> From: Barry Zubel <barry@stripped>
> To: dotnet@stripped
> A quick question to see if this has been noticed before.
> I'm populating a datatable direct from a MySql database via the 1.0.0
> mySql connector.
> Code is similar to the following:
> -- BEGIN CODE BLOCK --
> dim sSql as string = "SELECT JOB_NO, ORDVAL, REQD FROM S_MASTER"
> dim conn as new MySqlConnection(mainApp.mysql.connectionstring)
> dim comm as new MySqlCommand(sSql, conn)
> dim rs as new MySqlDataAdapter(comm)
> dim dt as new Datatable
> grdData.Datasource = dt
> -- END CODE BLOCK--
> grdData is a DataGrid, and displays the results perfectly... in most
> The case that I've come across is when you hit a DBNull value in one of
> the fields in the DataTable. I initially noticed that all the remaining
> fields in that column in the DataGrid were also null. Upon inspection
> of the DataTable object itself, it appears that the fields in the table
> are also null. When running the exact same parameter directly through
> PhpMyAdmin, results are displayed for those fields in the rows that are
> Is this an issue with the connector? I've highly-simplified the code in
> this email, but I'm about to go set up a clean-room test case and see if
> it still happens.
> Anyway - still looking forward to the next beta release, Reggie! ;)
Nordic Advice AB
114 51 Stockholm
Tel 08-545 802 40
Fax 08-661 12 70
Mobil 070-985 00 52