I have a Database with a Table named Orders and a column OrderNo. In a Form with a textbox ctlOrder I write the OrderNo value. This is the code:
When I open the Table Orders in the field OrderNo the value is the word theText instead of the value.Code:Dim theText As String theText = ctlOrder.Text Dim CNstring As String = "Data Source=EBELLO-PC\SQLEXPRESS;Initial " & "Catalog=Orders;Integrated Security=True" If CNstring.Trim = "" Then Exit Sub Dim CN As New SqlConnection(CNstring) Dim cmd As SqlCommand = New SqlCommand() cmd.CommandText = "INSERT INTO Orders(OrderNo) VALUES ('theText')" cmd.Connection = CN CN.Open() cmd.ExecuteNonQuery()




Reply With Quote
