image image Home   About   Downloads   Support   Links   Contact  
image





Copyright
2002 - 2012
Atozed Computer
Software Ltd.

image

Atozed Home  »  Indy Portal  »  Indy in Depth  »  Indy in Depth Change Log

Bonus Section: Extending C# to Support SQL Syntax at Compile Time

Ever wished you could truly embed SQL functionality in your C# code without using strings or late binding? Imagine being able to write complex where clauses purely in C#:

xQuery.Where =
  (CustomerTbl.Col.NameFirst == "Chad" | CustomerTbl.Col.NameFirst == "Hadi")
  & CustomerTbl.Col.CustomerID > 100 & CustomerTbl.Col.Tag != View.Null;

Look closely. This is C# code, not SQL. Its resolved and bound at compile time, but evaluated at run time. In this article I shall provide an introduction to this method and full source code for your use.



<< Previous Entry     Next Entry >>