You need to use SQL Reader to Show Data in Textbox or ListBox, Try the below code:
Dim CN As New OleDbConnection("You Connection Strting")
CN.Close()
Dim myCommand1 As New OleDbCommand("SELECT * from MyTable Where ID=@id", CN)
myCommand1.Parameters.Add(New OleDbParameter("id", OleDbType.VarChar)).Value = TxtId.Text
CN.Open()
Dim myReader As OleDbDataReader
myReader = myCommand1.ExecuteReader()
myReader.Read()
If myReader.HasRows Then
Textbox1.Text = myReader2("Name").ToString
Textbox2.Text = myReader2("Address").ToString
And for to bind the Listbox, you can use Dataset.
Dim cn As New OleDbConnection("Your Connection String")
cn.Open()
Dim qry As String = "SELECT ID,Name FROM MyTable"
Dim adp As New OleDbDataAdapter(qry, cn)
Dim ds As New DataSet
adp.Fill(ds, "MyTable")
ListBox1.DataSource = ds
ListBox1.DataTextField = "Name"
ListBox1.DataValueField = "ID"
ListBox1.DataBind()
Please dont forget to mark as answer.