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)
Related
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.
I am considering migrating from SQL Server 2008 to MySQL to save on licencing costs.
I was wanting to know if this would work and what sort of problems it might cause.
As I used EF Code first for the database, my databse is automatically generated based on my class structure. Would this, the entity framework and LINQ still work with a MySQL database?
Yes EF and LINQ works with MySQL as well, please take a look at these posts.
Entity Framework 5.0 code-first with MySQL Connector 6.6.5.0 on .Net 4.5
and
MySql and Entity Framework Code First
i have an existing database on local sql server 2008.
what should i do to access the database and to display the contents of that database.
i am using visual studio 2010 and i have to make a mvc3 web application for which i have to access the database.
should i have to make model classes(entity classes) or rather can these be generated from my database. please help me with this problem.
This is a very open question and any answer will depend a lot on personal preference. I would suggest that if you are using MVC3 and VS2010 you look at Entity Framaework, Microsofts ORM (Object relational mapper).
EF MVC Tutorial
You can produce a Model from the Database or Write a Domain model that mirrors the DB using Code First its up to you the tutorial linked explains how.
Alternatives would include Nhibernate, Subsonic and a bunch of other ORMs or just doing it all your self with ado connections and commands.
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.
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