0

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()

Edited by corleen19

3
Contributors
2
Replies
16
Views
3 Years
Discussion Span
Last Post by Deep Modi
0

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 topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.