Bug #5647 Retrieving integer fields on VB.Net
Submitted: 19 Sep 2004 0:07 Modified: 28 Sep 2004 20:02
Reporter: Marco Meza Email Updates:
Status: Not a Bug Impact on me:
Category:Connector / NET Severity:S1 (Critical)
Version:1-0-0 Beta OS:Microsoft Windows (Windows XP Pro SP2)
Assigned to: Reggie Burnett CPU Architecture:Any

[19 Sep 2004 0:07] Marco Meza
I'm trying to select four fields, two of them are varchar, and the other two are integer(6), but I can just retrieve the varchar ones.

Here is my source code:

I'm connecting with
OLEConn.ConnectionString = ("Server=localhost;Database=mysql;User ID=root;Password=;")
    Private Sub ListBox1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.DoubleClick
            xConn = New sqlConn
            xConn.connectMe("SELECT bpNombre, bpBinProcesador, bpBin, bpStatus FROM binporprocesador WHERE bpNombre ='" & ListBox1.SelectedItem & "';")

                xConn.OLEComm.Connection = xConn.OLEConn

                Dim d As MySql.Data.MySqlClient.MySqlDataReader = xConn.OLEComm.ExecuteReader()
                Do While d.Read
                    TextBox1.Text = d("bpNombre".ToString)
                    TextBox2.Text = d("bpBinProcesador".ToString)
                    TextBox3.Text = d("bpBin".ToString)
                    TextBox4.Text = d("bpStatus".ToString)
                    item1 = ListView1.Items.Add(d("bpNombre".ToString))
                    With item1
                    End With

                TextBox1.Enabled = True
                TextBox2.Enabled = True
                TextBox3.Enabled = True
                TextBox4.Enabled = True

                Catch err As System.Exception
                End Try
            Catch err As System.Exception
            End Try
        Catch err As System.Exception
        End Try
    End Sub

I've tried with corelab ADO connector, and it works perfect.
What I have done bad?

How to repeat:
Every time I select an item from the listbox, it crashes when writing an integer field into a textbox.
[19 Sep 2004 0:10] Marco Meza
Complete source code

Attachment: ArrayListEx.zip (application/x-zip-compressed, text), 96.07 KiB.

[28 Sep 2004 9:02] Reggie Burnett
Can you execute just a simple GetInt32() on the columns and tell me what values are coming back?  Are they null?  Perhaps you can post the releveant schema and data?
[28 Sep 2004 16:46] Marco Meza
I´ve solved it, I recovered it as UInt32, not as an integer, also I changed the field to "not" unsigned and no zerofill, and now it´s working ok.
[28 Sep 2004 20:02] Reggie Burnett
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.mysql.com/documentation/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Additional info:

Ok.  I am marking this as not a bug.  If you think it still represents incorrect behavior, then please let me know.