hi,
can i ask how do i insert my records from my textbox to specific column name of my table
IsConnected("Insert into products values(" & _
Me.TextBox1.Text & ",'" & _
Me.TextBox2.Text & "','" & _
Me.TextBox3.Text & "','" & _
Me.TextBox4.Text & "','" & _
Me.TextBox5.Text & "','" & _
Me.TextBox6.Text & "')", True)
here i used this code inserting it work, but now im going to insert records into specific column name like textbox1.text = id textbox2.text = lname like that.. here is my module code
Imports MySql.Data.MySqlClient
Module Module1
Public myConn As New MySqlConnection
Public myCmd As New MySqlCommand
Public myDR As MySqlDataReader
Public frUpdate As Boolean
Public Function IsConnected(ByVal strQry As String, ByVal ver As Boolean)
Try
If myConn.State = ConnectionState.Open Then myConn.Close()
myConn.ConnectionString = "server=localhost; user id=root; password=password; database=pms;"
myConn.Open()
myCmd.CommandText = strQry
myCmd.Connection = myConn
If ver = False Then
myDR = myCmd.ExecuteReader() 'Pra basahin ung query
Else
myCmd.ExecuteNonQuery() 'Pra iupdate ung query
End If
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error")
End Try
End Function
can you help me?