Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameters and Sql Command
Message
General information
Forum:
ASP.NET
Category:
ADO.NET
Environment versions
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01089693
Message ID:
01089698
Views:
22
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
Previous
Reply
Map
View

Click here to load this message in the networking platform