JohnDW
Well-known member
Dear forum members,
I am using vb 2010 at placing data in table.
I used following code
The message box, however, shows a value of 0. (Insert into Orders (Customer ID) values 0))
l wan't the value ( the Usernumber
In the form appears in txtUsernumber each customer number.
Can anyone help out?
Grt,
John
I am using vb 2010 at placing data in table.
I used following code
Private Sub Button3_Click (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim MyConnection As SqlConnection = Nothing As SqlTransaction = Nothing Dim MyTransaction MyConnection = New SqlConnection (Constant) MyConnection.Open () MyTransaction = MyConnection.BeginTransaction Dim SQL As String = "insert into Orders (Customer ID) values (: 0)" As New SqlCommand Dim CMD1 CMD1.Connection MyConnection = CMD1.Transaction = MyTransaction CMD1.CommandText = SQL CMD1.Parameters.AddWithValue (": 0," txtUsernumber.Text) MessageBox.Show (SQL)
The message box, however, shows a value of 0. (Insert into Orders (Customer ID) values 0))
l wan't the value ( the Usernumber
In the form appears in txtUsernumber each customer number.
Can anyone help out?
Grt,
John
Last edited by a moderator: