1.11M Members

GET DATA FROM MYSQL TO TEXTBOX

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

 
0
 

Follow this article: Link 1 and link 2 and link 3

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article