Torna al Thread
Function quote(ByVal testo)
quote = Replace(testo, "'", "''")
End Function
Dim Objconnection As New SqlConnection("Stringa_di_connessione")
Dim objcommand As SqlCommand = New SqlCommand()
Objconnection.Open()
objcommand.Connection = Objconnection
objcommand.CommandText = "INSERT INTO tab1(Nome,Cognome) VALUES ('" & quote(Me.TextBox1.Text) & "','" & quote(Me.TextBox2.Text) & "')"
objcommand.ExecuteNonQuery()
Objconnection.Close()