Link to home
Start Free TrialLog in
Avatar of vivian_870215
vivian_870215

asked on

visual basic.net- How to use My SQL display data to text box?

Hi, i am beginner.
How to use My SQL display data to text box?
data reader???
recordset???

Pls, i need help !
Thanks
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

What do you return from sql ? One field (one record), multiple fields (one record), multiple fields & multiple records... ?

ASKER CERTIFIED SOLUTION
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vivian_870215
vivian_870215

ASKER

Anyway thanks alot :D
Dim strConnectionString As String = "connetion string here"
    Dim cnn As New SqlConnection(strConnectionString)

    Dim cmd As SqlClient.SqlCommand = New SqlClient.SqlCommand("SELECT * FROM table ", cnn)
            cmd.CommandType = CommandType.Text
         Dim dacmd As New SqlClient.SqlDataAdapter(cmd)
        Dim dscmd As New DataSet
        dacmd.Fill(dscmd)
txtLastName.Text = dscmd.Tables(0).Rows(0).Item("FieldName")