0

I am on a visual basic mysql project
Here is the code :

Imports MySql.Data.MySqlClient


Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim conn As MySqlConnection
        conn = New MySqlConnection
        conn.ConnectionString = "server=db4free.net;Port=3306;user id=****; password=****; database=ume_corporation"
        conn.Open()

        Dim myadapter As New MySqlDataAdapter
        Dim sqlquery = "SELECT Lastname FROM users WHERE username ='a1a4a' "
        Dim mycommand As New MySqlCommand
        mycommand.Connection = conn
        mycommand.CommandText = sqlquery
        myadapter.SelectCommand = mycommand

        Dim ds As New DataSet("Cust")
        myadapter.Fill(ds, "users")
        cust.DataSource = ds.DefaultViewManager
        conn.Close()

    End Sub
   


End Class

My question is :
How can i display the Lastname data in a textbox called Textbox1.text ?

Edited by a1a4a: n/a

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by AndreRet
0

I have asked to move this from VB 4/5/6 to VB.Net. I'm sure you will find your solution there.:)

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.