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: