sealthiel_murice13
New member
- Joined
- May 24, 2009
- Messages
- 2
- Programming Experience
- 3-5
I got a trouble in inserting record in mysql using ODBC).
this is my sample code:
myinsert.CommandText = "INSERT INTO supplier( ID, SUPPLIERCODE, BUSINESSNAME, CONTACTPERSON, CONTACTNUM1, CONTACTNUM2, CONTACTNUM3, EMAILADD, BUSINESSADD, OTHERADD ) VALUES(?XID, ?SCODE, ?BUSS, ?CONT, ?CONTNUM1, ?CONTNUM2, ?CONTNUM3, ?EADD, ?BUSSADD, ?OTHADD)"
myinsert.Parameters.AddWithValue("@XID", txtnum.Text)
myinsert.Parameters.AddWithValue("@SCODE", txtsuppliercode.Text)
myinsert.Parameters.AddWithValue("@BUSS", txtsuppliercompany.Text)
myinsert.Parameters.AddWithValue("@CONT", txtsuppliername.Text)
myinsert.Parameters.AddWithValue("@CONTNUM1", txtcont1.Text)
myinsert.Parameters.AddWithValue("@CONTNUM2", txtcont2.Text)
myinsert.Parameters.AddWithValue("@CONTNUM3", txtcont3.Text)
myinsert.Parameters.AddWithValue("@EADD", txtadd1.Text)
myinsert.Parameters.AddWithValue("@BUSSADD", txtadd2.Text)
myinsert.Parameters.AddWithValue("@OTHADD", txtadd3.Text)
Try
conn.Open()
myinsert.ExecuteNonQuery()
Catch myerror As Exception
MsgBox("There was an error updating the database: " & myerror.Message)
End Try
any help.. i really appreciate for your emmidiate respose.
this is my sample code:
myinsert.CommandText = "INSERT INTO supplier( ID, SUPPLIERCODE, BUSINESSNAME, CONTACTPERSON, CONTACTNUM1, CONTACTNUM2, CONTACTNUM3, EMAILADD, BUSINESSADD, OTHERADD ) VALUES(?XID, ?SCODE, ?BUSS, ?CONT, ?CONTNUM1, ?CONTNUM2, ?CONTNUM3, ?EADD, ?BUSSADD, ?OTHADD)"
myinsert.Parameters.AddWithValue("@XID", txtnum.Text)
myinsert.Parameters.AddWithValue("@SCODE", txtsuppliercode.Text)
myinsert.Parameters.AddWithValue("@BUSS", txtsuppliercompany.Text)
myinsert.Parameters.AddWithValue("@CONT", txtsuppliername.Text)
myinsert.Parameters.AddWithValue("@CONTNUM1", txtcont1.Text)
myinsert.Parameters.AddWithValue("@CONTNUM2", txtcont2.Text)
myinsert.Parameters.AddWithValue("@CONTNUM3", txtcont3.Text)
myinsert.Parameters.AddWithValue("@EADD", txtadd1.Text)
myinsert.Parameters.AddWithValue("@BUSSADD", txtadd2.Text)
myinsert.Parameters.AddWithValue("@OTHADD", txtadd3.Text)
Try
conn.Open()
myinsert.ExecuteNonQuery()
Catch myerror As Exception
MsgBox("There was an error updating the database: " & myerror.Message)
End Try
any help.. i really appreciate for your emmidiate respose.