Reputation: 12864
I was using ADO.Net in my .Net projects from the past few years. Now I started using Linq2Sql and Entity Framework.
When using ADO.Net application my client should have SQL Server in their system to access the database file.
But some one has told me that Linq2Sql and Entity Framework doesn't need SQL Server on the client, it just need the .mdf
file to access the database.
Because in LinqToSql we give the connection as the path of .mdf file
DataContext dc= new DataContext("path to database file");
Is it true?
Please explain me all the things.
Upvotes: 0
Views: 351
Reputation: 5405
You're thinking User Instances, replaced by LocalDB in SQL Server 2012. This has nothing to do specifically with Linq to SQL or Entity Framework. And all these options require installing SQL Server on the client machine.
Upvotes: 0
Reputation: 6218
It is not related with ADO.net or LINQ2SQL or EntityFramework. It is related with which Database Edition you are using. And I don't think you can use .mdf file without Installing SQL Database Server from any of above data access technology.
May be you are referring to SQL Compact Edition (.sdf). Which you can use without installing SQL Server. (You can also connect with ADO.net to .sdf database file)
myConnection = new SqlCeConnection("Data Source=\\Mobile\\Northwind.sdf;");
myConnection.Open();
Upvotes: 1
Reputation: 30097
I highly doubt that you can directly use ,mdf file without SQL Server because
Database transactions are not simply file reading and writing that can be done directly against .mdf file.
LINQ to SQL queries are first converted into SQL and then executed. Without SQL Server engine, how these SQL queries would be interpreted
Upvotes: 3