I dont know what code to put Here?
to get the exact value of my record on my database
here is my code
Protected Const strConnPubs As String = "server=localhost; user id=root; password=phoenix0931; database=accounts;"
Protected strPubsCMD As String = "select customers_id, customer_name from customers"
Protected dvName As DataView
Protected dsName As New DataSet()
Private Sub Form8_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
loadcus()
End Sub
Private Sub loadcus()
Try
Dim cnPubs As MySqlConnection = New MySqlConnection(strConnPubs)
Dim PubsDA As New MySqlDataAdapter(strPubsCMD, cnPubs)
PubsDA.Fill(dsName, "customers")
dvName = New DataView(dsName.Tables("customers"), "", "customers_id", DataViewRowState.OriginalRows)
With ComboBox1
.ValueMember = "customers_id"
.DisplayMember = "customer_name"
.DataSource = dvName
End With
ComboBox1.SelectedIndex = -1
cnPubs.Dispose()
PubsDA.Dispose()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Information, Me.Text)
End Try
End Sub
this is the code i use to get the address on textbox1
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
TextBox2.Text = ComboBox1.SelectedIndex.ToString
End Sub
The problem is the textbox 1 displays only numbers not the address