Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 07, 2012 12:45 AM by Decker Dong - MSFT
Dec 05, 2012 07:51 PM|LINK
trying to figure out this whole LINQ thing......
seems to me....many moons ago we had sql embedded directly in our ASP pages. this was deemed "bad". so we moved to stored procedures and passing parameters. now.....we are back to having sql embedded into our pages using LINQ. isn't this idea STILL bad since
making changes to the sql will require recompiling the code?
just wondering if someone could shed some light....
Dec 05, 2012 08:51 PM|LINK
we are back to having sql embedded into our pages using LINQ
There's no SQL in your page if you are using LINQ To SQL or Entity Framework - not if you are doing it right. LINQ is pure C#.
Dec 05, 2012 11:43 PM|LINK
The right way to do this is to create methods in your Classes that return data in a form that the web page can use.
I generally make these methods static so that I don't have to instatiate a class in order to use them.
Other methods that use data in the Class can be non-static members of the class.
Dec 07, 2012 12:45 AM|LINK
LINQ means Lnaguage IN Query, this is a language something like the 4th generation of programming ones，which means you only tell the PC what to do, you don't need to care about How to do (Compared with the 3rd generation of proramming language
such as VB.NET or C#……)，
Linq also extends many parts——to db, there are LINQ-TO-SQL or LINQ-TO ENTITY. Both of them can be recognized by VS studio to check whether there are syntax errors.