1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
<%
Dim oConnection As System.Data.SqlClient.SqlConnection
' Création de l'objet de connexion
oConnection = New System.Data.SqlClient.SqlConnection()
' Ecriture de la chaîne de connexion
Dim sConnectionString As String
sConnectionString = "Server=....;Initial Catalog=.....;uid=...;password=ANASTASI20"
oConnection.ConnectionString = sConnectionString
Dim cmd As New System.Data.SqlClient.SqlCommand
cmd.CommandType = System.Data.CommandType.Text
cmd.CommandText = "insert into table VALUES ('3','2','3',null,'1')"
cmd.Connection = oConnection
' Ouverture de la connexion
oConnection.Open()
cmd.ExecuteNonQuery()
' Fermeture de la connexion
oConnection.Close()
%> |
Partager