Quote:
Dim Connection As New SqlConnection
Dim mySqlCommand As SqlCommand = New SqlCommand
Dim a As String
Connection.ConnectionString = ("Data Source=...")
Connection.Open()
mySqlCommand.Connection = Connection
Try
mySqlCommand.CommandText = "INSERT INTO ab (a, b) VALUES (@a, @b)"
Dim InsertCommand As SqlCommand = New SqlCommand
mySqlCommand.Parameters.AddWithValue("@a", AB2generator(5))
a = AB2generator(5)
mySqlCommand.Parameters.AddWithValue("@b", abgenerator(a))
mySqlCommand.ExecuteNonQuery()
MessageBox.Show("New Customer Added To Your Database")
Catch ex As Exception
MessageBox.Show("Customer could not be added!" & ex.Message)
Finally
If Connection.State = ConnectionState.Open Then
Connection.Close()
End If
End Try
thanks