This is the code I got, but using this I cannot update custname
. I need to use id in this which is autoincremented in database.
con2.Open()
Dim query As String
query = "update CustomerMaster set CustName='" + TextBox1.Text + "',Address='" + TextBox2.Text + "',Phone='" + TextBox3.Text + "',Mobile='" + TextBox4.Text + "',email='" + TextBox5.Text + "'where CustName='" + TextBox1.Text + "'"
cmd = New SqlCommand(query, con2)
Dim reader2 As SqlDataReader
reader2 = cmd.ExecuteReader
MessageBox.Show("Data updated")
con2.Close()
This is a snap from a Youtube video in this they use datagrid view but in my form it is listbox so can anyone convert this code to use in listbox
Actually I want to find the id in vb.net which is invisible and only can see in sql server.