We help IT Professionals succeed at work.

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

661 Views
Last Modified: 2013-11-05
Hi, i am beginner.
How to use My SQL display data to text box?
data reader???
recordset???

Pls, i need help !
Thanks
Comment
Watch Question

Dirk HaestProject manager
CERTIFIED EXPERT

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

Project manager
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Anyway thanks alot :D
Dirk HaestProject manager
CERTIFIED EXPERT

Commented:
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")
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.