Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select Statement
Message
 
À
17/04/2003 15:23:33
Sergio Ortiz
Tek Services Group, Llc
Hollywood, Floride, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
00778464
Message ID:
00779243
Vues:
25
>do you know of any example of doing parametirized queries.

Here is a simple one. Basically you define the parameter in the SQL statement by prefixing it with "@" - You then use the Parameters.Add method to set its value.
Try
   Dim sc As New SqlCommand()
   sc.Connection = oConn <--- you SQL Connection object goes here
   sc.CommandText = "select myfield from mytable where myfield = @MyValue"
   sc.Parameters.Add("@MyValue", "somevalue" )
   x = sc.ExecuteScalar()
Finally
   oConn.Close()
End Try
Hector Correa
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform