Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: Samir Ibrahim
  Where is Samir Ibrahim?
 Chekka
 Lebanon
 Samir Ibrahim
 To: Christian Tabligan
  Where is Christian Tabligan?
 Bacolod City, Neg. Occ.
 Philippines
 Christian Tabligan
 Tags
Subject: RE: C#.net Macro like VFP
Thread ID: 233116 Message ID: 233304 # Views: 37 # Ratings: 0
Version: Unknown Category: .NET
Date: Wednesday, July 01, 2009 11:27:23 AM         
   


> > 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 database
I 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+.....
> > &aa


That 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



COMPLETE THREAD
C#.net Macro like VFP Posted by Gary Abellar @ 6/30/2009 5:53:19 AM
RE: C#.net Macro like VFP Posted by Boudewijn Lutgerink @ 6/30/2009 9:07:54 AM
RE: C#.net Macro like VFP Posted by kulwant singh @ 6/30/2009 9:39:19 AM
RE: C#.net Macro like VFP Posted by Camil Ghircoias @ 6/30/2009 1:46:47 PM
RE: C#.net Macro like VFP Posted by kulwant singh @ 7/1/2009 10:15:43 AM
RE: C#.net Macro like VFP Posted by Samir Ibrahim @ 6/30/2009 11:04:19 AM
RE: C#.net Macro like VFP Posted by Christian Tabligan @ 6/30/2009 1:27:22 PM
RE: C#.net Macro like VFP Posted by Cetin Basoz @ 6/30/2009 1:33:54 PM
RE: C#.net Macro like VFP Posted by Camil Ghircoias @ 6/30/2009 1:49:24 PM
RE: C#.net Macro like VFP Posted by Cetin Basoz @ 6/30/2009 1:57:02 PM
RE: C#.net Macro like VFP Posted by Camil Ghircoias @ 6/30/2009 2:08:46 PM
RE: C#.net Macro like VFP Posted by Cetin Basoz @ 6/30/2009 2:19:52 PM
RE: C#.net Macro like VFP Posted by Camil Ghircoias @ 6/30/2009 2:37:39 PM
RE: C#.net Macro like VFP Posted by Cetin Basoz @ 6/30/2009 2:47:13 PM
RE: C#.net Macro like VFP Posted by Camil Ghircoias @ 6/30/2009 2:54:24 PM
RE: C#.net Macro like VFP Posted by Cetin Basoz @ 6/30/2009 3:05:10 PM
RE: C#.net Macro like VFP Posted by Boudewijn Lutgerink @ 6/30/2009 3:11:24 PM
RE: C#.net Macro like VFP Posted by Cetin Basoz @ 6/30/2009 3:19:43 PM
RE: C#.net Macro like VFP Posted by Samir Ibrahim @ 6/30/2009 3:40:39 PM
RE: C#.net Macro like VFP Posted by Cetin Basoz @ 6/30/2009 3:46:58 PM
RE: C#.net Macro like VFP Posted by Samir Ibrahim @ 6/30/2009 4:07:22 PM
RE: C#.net Macro like VFP Posted by Boudewijn Lutgerink @ 6/30/2009 3:04:07 PM
RE: C#.net Macro like VFP Posted by Cetin Basoz @ 6/30/2009 3:11:23 PM
RE: C#.net Macro like VFP Posted by Boudewijn Lutgerink @ 6/30/2009 3:17:23 PM
RE: C#.net Macro like VFP Posted by Cetin Basoz @ 6/30/2009 3:40:24 PM
RE: C#.net Macro like VFP Posted by Christian Tabligan @ 7/1/2009 1:35:49 AM
RE: C#.net Macro like VFP Posted by Christian Tabligan @ 7/1/2009 5:17:51 AM
RE: C#.net Macro like VFP Posted by Camil Ghircoias @ 7/1/2009 9:18:05 AM
RE: C#.net Macro like VFP Posted by Christian Tabligan @ 7/1/2009 10:12:31 AM
RE: C#.net Macro like VFP Posted by Camil Ghircoias @ 7/1/2009 10:43:26 AM
RE: C#.net Macro like VFP Posted by Cetin Basoz @ 7/1/2009 2:01:48 PM
RE: C#.net Macro like VFP Posted by Camil Ghircoias @ 7/1/2009 2:33:27 PM
RE: C#.net Macro like VFP Posted by Cetin Basoz @ 7/1/2009 3:51:25 PM
RE: C#.net Macro like VFP Posted by Camil Ghircoias @ 7/1/2009 4:45:01 PM
RE: C#.net Macro like VFP Posted by Boudewijn Lutgerink @ 7/1/2009 4:57:05 PM
RE: C#.net Macro like VFP Posted by Cetin Basoz @ 7/1/2009 10:05:06 PM
RE: C#.net Macro like VFP Posted by Christian Tabligan @ 7/2/2009 2:09:41 AM
RE: C#.net Macro like VFP Posted by Boudewijn Lutgerink @ 7/1/2009 4:48:44 PM
RE: C#.net Macro like VFP Posted by Samir Ibrahim @ 7/1/2009 11:27:23 AM
RE: C#.net Macro like VFP Posted by Christian Tabligan @ 7/2/2009 1:40:38 AM