> > Hi,
> >
> > It is possible to do thinks in c# like composing a complex command and then executing it with & (using a runtime compiler component) like in vfp ? I'm just courious.
> >
> > aa="select all ..."+cWherecondition+.....
> > &aa
> >
> >
> > Camil Ghircoias
> > Vfp likes me.
>
> C# doesn't have built-in database. You cannot invoke SQL Commands , unless, otherwise, you used connection strings to pass those string commands to database.
>
> Macro Substitution (&) is the advantage of VFP from other language but I tell you, programming doesn't end in just a single macro. If you want challenge, and adventure to new language, you must explore it's features.
>
> Before, I tried to find macro in C# but then i was disappointed. :-)
>
> Best Regards,
>
> CriZ (,")
>
> "Happiness is real when shared."
Before, I tried to find macro in C# but then i was disappointed. :-) You have here 3 example of macro (me and you and Cetin) and you still disappointed?
Since Camil ask the question, and I was gonna answer under Camil, but I thought it would be better to answer under your name since you are (somehow) give not complete information to him.
C# doesn't have built-in databaseI guess it have, and it is called SQL Server Compaq
You cannot invoke SQL Commands , unless, otherwise, you used connection strings to pass those string commands to database.You can invoke SQL commands without using (manually) the connection string, just add a data source to the project
> > aa="select all ..."+cWherecondition+.....
> > &aaThat can be done by the following
Imports System.Xml.Linq
Dim myfields As String = "myfield1,myfield2"
Dim mytable As String = "mytable"
Dim mywhere As String = " where myfield1 = " + "myfield1 value"
Dim myorder As String = " order by " + "myorder"
Dim myquery As XElement
myquery = <string>
select <%= myfields %>
from <%= mytable %>
<%= mywhere %>
<%= myorder %>
</string>
Debug.Print(myquery)
I don't know C#, but my code can easially be done in C# in you converted.
The point is, .Net is very wide and large, and for some one new comming to .net world like me and you, there is a lot to discover.
Samir Ibrahim