Main Page | Report this Page
.NET DotNet Forum Index  »  ADO .NET Forum  »  Convert SQL to linq (automatically)...
Page 1 of 1    

Convert SQL to linq (automatically)...

Author Message
Chris Kennedy...
Posted: Tue Sep 16, 2008 4:54 pm
Guest
Is there any way to convert fairly basic queries (selects joining across
several tables) into linq? Here's the idea - I use views to act as the basis
for my data access layer (code generated). However I can't use views
directly because they don't use indexes properly (or so I'm told). I just
want to use the views as a place to store select statements. I want to grab
the view definition and convert it to linq and then I can easily add paging.
It doesn't look too hard to convert the select statements into linq as long
as they remain simple and strictly formatted. It's just I was wondering if
anyone had experience (and code) of doing something like this. If the views
get changed then the code generation would break. I am new to this and I am
open to any better ideas.
 
Cor Ligthert[MVP]...
Posted: Wed Sep 17, 2008 11:52 pm
Guest
Hi Chris,

Drag your View into the left Datacontext surface using Server Explorer and
you are almost ready (You open the DataContext by selecting Linq to SQL
from your new items in a project in Solution Explorer)

Cor

"Chris Kennedy" <chris.kennedy10 at (no spam) btinternet.com> schreef in bericht
news:eOaGUbEGJHA.1272 at (no spam) TK2MSFTNGP02.phx.gbl...
Quote:
Is there any way to convert fairly basic queries (selects joining across
several tables) into linq? Here's the idea - I use views to act as the
basis for my data access layer (code generated). However I can't use views
directly because they don't use indexes properly (or so I'm told). I just
want to use the views as a place to store select statements. I want to
grab the view definition and convert it to linq and then I can easily add
paging. It doesn't look too hard to convert the select statements into
linq as long as they remain simple and strictly formatted. It's just I was
wondering if anyone had experience (and code) of doing something like
this. If the views get changed then the code generation would break. I am
new to this and I am open to any better ideas.
 
...
Posted: Tue Oct 06, 2009 10:45 pm
Guest
Linqer is SQL to LINQ converter.
Check http://www.sqltolinq.com




Chris Kennedy wrote:

Convert SQL to linq (automatically)
16-Sep-08

Is there any way to convert fairly basic queries (selects joining across
several tables) into linq? Here's the idea - I use views to act as the basis
for my data access layer (code generated). However I can't use views
directly because they don't use indexes properly (or so I'm told). I just
want to use the views as a place to store select statements. I want to grab
the view definition and convert it to linq and then I can easily add paging.
It doesn't look too hard to convert the select statements into linq as long
as they remain simple and strictly formatted. It's just I was wondering if
anyone had experience (and code) of doing something like this. If the views
get changed then the code generation would break. I am new to this and I am
open to any better ideas.

EggHeadCafe - Software Developer Portal of Choice
SumColumn: Custom DataGrid Column that automatically shows Sum/Count/Average in DataGrid Footer.
http://www.eggheadcafe.com/tutorials/aspnet/cd3bb8d3-2608-487d-be33-1248becf3e16/sumcolumn-custom-datagri.aspx
 
 
Page 1 of 1    
All times are GMT - 5 Hours
The time now is Fri Dec 04, 2009 11:49 am