How can you handle concurrency at field level in LINQ to SQL?

In LINQ to SQL, you can also handle concurrency at field level and this is the best way provided by the LINQ. To achieve this you need to define UpdateCheck attribute at field level and it has the following options: Never: – This option will never check for concurrency conflicts. Always: – This option will always check for concurrency conflicts. WhenChanged: – This option will check for concurrency conflicts when the field’s value has been changed.

How can you handle concurrency in LINQ to SQL?

When multiple users are updating the same record at the same time, a conflict will occur. To handle this concurrency conflicts, LINQ provides you following three ways. KeepCurrentValues – This option will remains the LINQ object values as it is and does not push the new values from the database in to the LINQ object. OverwriteCurrentValues – This option will replace the LINQ object values with the database values. KeepChanges – In this case changed properties of an object/entity remains as it is but the properties which are not changed are fetched from the database and replaced. All these options … Click here to continue…..

What is difference between ADO.NET and LINQ to SQL?

There are following differences between ADO.NET and Entity Framework: ADO.NET LINQ to SQL It is a part of .NET Framework since .NET Framework 1.0 It is a part of .NET Framework since .NET Framework 3.5 SqlConnection/OleDbConnection is used for database connectivity. We can use context for database connectivity. Difficult to debug and cause syntax errors at run-time. Easy to debug and cause syntax errors at compile-time. It has full type checking at run-time and no IntelliSense support in Visual Studio, since it used the T-SQL to query the database. It has full type checking at compile-time and IntelliSense support in … Click here to continue…..

What is difference between XElement and XDocument?

XElement and XDocument are the classes defined with in System.Xml.Linq namespace. XElement class represents an XML fragment. While XDocument class represents an entire XML document with all associated properties. For Example: