I have the following code, where I am trying to trigger multiple SQL statements.
I am new to SQL, can anybody help me with the correct syntax?
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim con As SqlConnection = New SqlConnection("server=barry-laptop\SQLEXPRESS; database=Test; integrated security=yes")
Dim cmd As SqlCommand = New SqlCommand("CREATE TABLE " + TextBox2.Text + " " + "(myId INTEGER PRIMARY KEY," + "myName CHAR(50), myAddress CHAR(255), myBalance FLOAT)", con)
Dim cmd2 As SqlCommand = New SqlCommand("Update Tarrifs Set Name='" & TextBox2.Text & "', con")
con.Open()
cmd.ExecuteNonQuery()
cmd2.ExecuteNonQuery()
con.Close()
End Sub
Any help appreciated.
Thanks,