From: Guy Platt Date: September 29 2004 6:31am Subject: Re: [Fwd: Odd ?bug? with DBNull Values] List-Archive: http://lists.mysql.com/dotnet/11 Message-Id: <415A56D5.3040605@nordicadvice.se> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070906000506040208050505" --------------070906000506040208050505 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit 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 which then causes a crash when I try and assign it to a string value. -- Guy 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 > charm. > > Still looking forward to Beta 2 though! ;) > > B. > > -------- Original Message -------- > Subject: Odd ?bug? with DBNull Values > Date: Tue, 28 Sep 2004 15:08:07 +0100 > From: Barry Zubel > 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) > conn.open > dim comm as new MySqlCommand(sSql, conn) > dim rs as new MySqlDataAdapter(comm) > dim dt as new Datatable > > rs.fill(dt) > > grdData.Datasource = dt > -- END CODE BLOCK-- > > grdData is a DataGrid, and displays the results perfectly... in most > cases. > > 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 > affected. > > 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! ;) > > B. > -- Nordic Advice AB Strandvägen 5B 114 51 Stockholm Tel 08-545 802 40 Fax 08-661 12 70 Mobil 070-985 00 52 Email guy.platt@stripped www.ppmradet.se --------------070906000506040208050505--