Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select Statement
Message
 
À
16/04/2003 13:39:38
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:
00778467
Vues:
23
String strSelect = "SELECT ins1ln, ins1fn, pxd FROM Policy WHERE agent = '"+MyAgent+"'"

Although, it would be better and more secure to use parameters, not a concatenated string.

>I have a grid on a web form and I am trying to populated it with the following Select statement:
>
>MyAgent = Session["ProducerCode"].ToString();
>String strSelect = "SELECT ins1ln, ins1fn, pxd FROM Policy WHERE agent = MyAgent" ;
>

>
>The problem is that my Where clause does not recognize the variable MyAgent.
>
>Can anybody help me to populate the Where clause with a Session variable.
>
>I am using C#.
>
>Thanks,
>Sergio
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform