Filed in: Entity Framework, Linq To Sql
Home » Linq To Sql
Linq to Sql has a caching system that rely on the primary key of each object. Inside the data context, an identity map keep the value of the retrieved data. Every thing is handled by the data context and you have to worry about nothing. Keep in mind that if someone else change the value that the cache won’t be refreshed.
If you change the data...
To create a new Linq To Sql classes to communicate with your database you need to add a new item of Linq To Sql classes types in Visual Studio.
Create new Linq to Sql classes
Once created, the next step is to drag and drop table into the Visual Designer. This will generate Linq To Sql data class. You can also drag and drop stored procedure to be used.
When...
Filed in: Linq To Sql
I have seen in many website the differences between Linq to Sql and Entity Framework but the most effective summary I saw is from the book “MCTS Self Paced Traning Kit Exam 70-516″. Here is the table without their explication.
Difference between Linq to Sql and EntityFramework comparison table
Tweetgovernment,politics news,politics news,politics
It’s possible to log all SQL Query generated by Linq to Sql with C# code. This can be useful when debugging or to optimize how the Linq is done.
DataClasses1DataContext db = new DataClasses1DataContext();
StringWriter sw = new StringWriter();
db.Log = sw;
this.gridLinqToSql.DataSource = db.Customers.Where(c => c.CustomerID.StartsWith("A"));
this.gridLinqToSql.DataBind();...
Filed in: Linq To Sql