What's new in Linq to SQL in .NET 4.0 - linq-to-sql

Does anyone know if there is anything new in LINQ to SQL in the 4.0 Framework? I know they said LINQ to SQL was not going to be supported anymore in favor of pushing the Entity Framework, but maybe they added new features or fixed some bugs.

Damien Guard compiled a comprehensive list of changes to LINQ to SQL in .NET 4.
Most changes are minor, but there were various improvements made, especially in performance and stability.

Related

Entity Framework/LINQ/MSSQL vs Entity Framework/LINQ/MYSQL

My question is this. When trying to decide between using the Entity Framework and LINQ to SQL as an ORM, I am trying to figure out whether to use MSSQL or MYSQL....which one is preferred?
I heard that LINQ to SQL is tied to SQL Server is that still true?
NET integration story (C#, Linq, Entity Framework, etc.) in SQL Server is better is what I heard,please share your opinions
LINQ to SQL was introduced as part of .net 3.5 from memory. I don't see why you'd use it over EntityFramework now however, EF has come a long way and provides as far as I'm aware all the features LINQ to SQL did:
https://github.com/aspnet/EntityFramework6
EF and Linq to Sql are both Microsoft products, and SQL Server is a Microsoft product. Mysql is not a Microsoft product. In my experience, things work better if you stick with the same vendor. If you go with EF or Linq to SQL, and you have no other reasons to choose one over the other, my guess is you'll be happier if you pair it with SQL Server.

linq to mySQL How can I trick VB Express to use it?

I'm currently using VB.NET Express to connect to mySQL over the net. No problem as long as I use plain vanilla SQL connections and statements.
But when it comes to LINQ 2 mySql, I'm struck by VB Express's limitation.
Any clue you gurus?
You'll need to switch out to using something like DBLinq, Entity Framework, or nHibernate instead of Linq-to-SQL. Linq-to-SQL only supports SQL Server and SQL Server CE. This isn't a
limitation of Visual Studio Express at all. Actually, the only limitations I know of with the express editions are that they don't support any Visual Studio plug-ins - but as far as CLR features, you aren't limited at all using Express. And, Entity Framework is built-in and available for you to use out of the box. And stackoverflow has info on the MySQL connector.
After a couple of days searching, Iv' finally reached the Saint Graal!
Since you guys at StackOverflow are so great a bunch of blokes, I've written a little how to sample for you. Here it is:
1 - The ONLY sensible, free and working product I've founr is Devart LinqConnect Express edition.
Its a free product from www.devart.com, capable of:
(Please note I have no particular links nor interest with them.)
Generating datacontext from its own embarked Devart EntityDeveloper free edition
(With some limits in number of tables per context, 10 if I'm right).
Complete the LINQ dlls into Visual Basic Express edition, without having to create a datasource from the datasource explorer.
Ok, once you've installed the package, here's the how to:
Launch the Entity designer from Program Files\Devart LinqConnect and create the model from the database.
Save the model and launch your VB Winform project.
Add the following .NET references:
Devart.Data.Linq
Devart.Data.MySql.Linq '-- Or any other DB you need
System.Data.Linq
Now add the new datacontext.designer.vb file you've created in Entity Developer
to the project:
Right-click the project in Solution Explorer and select
Add existing item
Locate the datacontext file and that's almost it!
Create a button and a datagridview named dgv1 onto your form.
5 more lines of code and you're set!
Button code:
Dim ctx As New myDataContext.myDataContext
Using ctx
Dim tbl = From xxx In ctx.myTable
Select xxx
dgv1.DataSource = xxx.ToList
End Using
The rest is pure cosmetic LOL...
It is worth to mention that although their product is great, the support is great as well!
They answered my questions in less than 12 hours.

Using SQL Server 2008 R2 with Visual Studio Express

I want to create either "LINQ to SQL" classes or use "Entity Framework" from Visual Studio Express 2010. When I attempt to add a data source my only options are:
"Microsoft Access Database File"
"Microsoft SQL Server Compact 3.5"
"Microsoft SQL Server Database File"
Do I need VS2010 Pro to use LINQ to SQL or EF? I thought I could do all of this from Express. I even went so far as to install, "Microsoft SQL Server 2008 Native Client" and it still doesn't show SQL Server 2008 as a data source.
Thanks!
p.s. I feel like a complete idiot that I cannot get this to work
LINQ to SQL (L2S) and LINQ to Entities (L2E) (aka Entity Framework) are part of the .NET Framework, and so are part of .NET regardless of what version of VS you use.
Both first appeared in 3.5 and are updated in 4.0, although LINQ to SQL won't be progressed any further in terms of functionality. Hence there isn't a dependency on the IDE. What might be missing is the LINQ to SQL or LINQ to Entity designers, but I don't think from memory they are.
If you select Add New Item and look in the Data group you should find "LINQ to SQL classes" and "ADO.NET Entity Data Model" - if not perhaps the designers are not part of Express.
[edit]
Seems this has been asked before:
Connecting to SQL Server with Visual Studio Express Editions
For LINQ, use SQLMetal to generate the spew and then just form connection string and let the code connect - you shoudldn't let VS mess with your data representation anyway. SQLMetal's spew is very clean and you can also edit it, once you learn what's what, to make it lighter - or heavier :-) - there are hooks for more code as well.
Before that check that your SQL instance is running and visible - VS installed SQL Express as default instance it can prevent real SQL's default instance from even being visible - a lot of uninstalls in your future if that happened.

what ADO.Net version is currenlty used in ASP.net MVC 2?

Current ASP.Net MVC 2 uses Linq to SQL or Linq to entites? i am using VS 2008.
ASP.NET MVC 2 can also be used with normal ADO.NET. What you use for your data access has nothing to do with what technology you use on the UI side of your architecture.
What probably confuses you a bit at this moment is that you see mostly examples written with Linq to Sql or Entity Framework. However these could also be written with other technologies like Subsonic or NHibernate.
Read this article: Extending NerdDinner: Exploring Different Database Options. It shows the following technologies:
ADO.NET Connected (DataReaders)
ADO.NET Disconnected (DataSets)
LINQ to SQL
LINQ to Entities (Entity Framework)

LINQ to SQL vs Entity Framework for an app with a future SQL Azure version

I've got a vertical market Dot Net Framework 1.1 C#/WinForms/SQL Server 2000 application. Currently it uses ADO.Net and Microsoft's SQLHelper for CRUD operations.
I've successfully converted it to Dot Net Framework 4 C#/WinForms/ SQL Server 2008. What I'd like to do is also offer my customers the OPTION to use SQL Azure as a backend storage for their data instead of local/LAN SQL Server.
If I know SQL Azure is in my application's future, should I:
A. Switch to LINQ to SQL
or
B. Swith to Entity Framework
or
C. Stick with ADO.Net and SQLHelper
?
Thanks !
I would switch to Entity Framework, it works just fine with SQLAzure and is the recommended ORM by Microsoft for .Net 4
ADO.net works just fine,
My personal favorite is Linq2Sql which works fine with azure
Microsoft is now recommending that everyone switch to entity framework