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()
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5