Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parameters and Sql Command
Message
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Versions des environnements
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01089693
Message ID:
01089698
Vues:
23
Glenn,

In C# (I think it may be the same in VB, you can do it like this:
lcSql = string.Format("select {0} from {1} where {2}", lcFields, lcTable, lcWhere);
Actually, you'll need to check the overloads of the Format method because I think it only takes two extra arguments when used in this way. So, if you have more, you can pass the string and an array of substitution values.

Edit: Glenn, I just checked this in both C# and VB and the above should work for you as is. Both languages support an overload that takes a string and 3 objects. Any more than that and you'll have to go the object array route.

HTH,
Chad

>I am accustomed to building a Sql command in VFP like follows:
>
>text to lcSql textmerge
>select <<lcfields>> from <<lcTable>> where <<lcwhere>
>endtext
>
>
>I wonder what are the ways which a SQL command can be constructed in VB.Net besides string concatenation.
>
>Thanks
>
>Glenn
_________________________________
There are 2 types of people in the world:
    Those who need closure
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform