>Is there anyway to do FoxPro Style Macro Substitution in C#?
>
>For example in FoxPro you can do something like this:
>
>
>lcFieldName = "Address"
>SELECT name, &lcFieldName, city, state, zip FROM customers INTO CURSOR x
>
>
>The &lcFieldName above does a macro substitution putting "Address" into the SQL statement. Is there something similar in C#?
As Naomi points out you can, in this case, simply build up the string.
But the short answer is No - there is no simple equivalent in C# (because it is a compiled language).
It is possible to dynamically compile C# at runtime (see System.CodeDom and Microsoft.CSharp.CSharpCodeProvider namespaces) -
but it fairly laborious although infinitely flexible.