Start New Discussion within our Software Development Community

HEY THERE! COULD ANYONE HELP ME WITH THIS?
THIS CODE DOESN'T HAVE AN ERROR BUT MY PROBLEM IS NOTHING DISPLAYS ON MY TEXTBOX.
I WANT TO GET THE VALUE FROM MY MYSQL DATABASE TO TEXTBOX. Is there another way to do?

                       dbcon = getconnect()
                    dbcon.Open()

                    cmd = New MySqlCommand("select * from performancetbl where perfevalid='" & frmClientAuthenticationCode.txtperfevalID.Text & "'", dbcon)
                    dr1 = cmd.ExecuteReader

                    If dr1.HasRows Then
                        dr1.Read()
                        frmClientAuthenticationCode.txtperfevalID.Text = dr1.Item("perfevalID")
                        frmClientAuthenticationCode.txtsize.Text = dr1.Item("SIZE")
                    End If
                    dr1.Close()
                    dbcon.Close()
                    dbcon.Dispose()



                cmd = New MySqlCommand("select * from performancetbl where perfevalid='" & frmClientAuthenticationCode.txtperfevalID.Text & "'", dbcon)
                dr1 = cmd.ExecuteReader

                If dr1.HasRows Then
                    dr1.Read()
                    frmClientAuthenticationCode.txtperfevalID.Text = dr1.Item("perfevalID")
                    frmClientAuthenticationCode.txtsize.Text = dr1.Item("SIZE")
                End If
                dr1.Close()
                dbcon.Close()
                dbcon.Dispose()

try dr1.Item("perfevalID").Value and if that doesn't work then have a look at the examples here. But first make sure that the query actually returns data. If there are no matching records then you won't see any data.

This article has been dead for over six months. Start a new discussion instead.