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

Recommended Answers

All 2 Replies

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.