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 ?

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

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.