Tag: LINQ toSQL
-
ASP.Net GridView with LinqDataSource
In this post I will walkthrough on using ASP.Net Gridview with LinqDatasource. You can bind a GridView with LinqDataSource and would able to Edit Delete View data without writing a single line of code. To see how it works , follow the steps below; Step1 Crate a ASP.Net Web Application. Step 2 Right click and…
-
Learning Video Executing Stored Procedure in LINQ to SQL
Source code used in Video ***********************************************************
-
Executing SQL Query using LINQ to SQL
In this post, I will discuss how we can execute a SQL Query directly from LINQ. Explanation To execute SQL query there is a method in DataContext class called ExecuteQuery ExecuteQuery takes two input parameter 1. SQL Query as string 2. Parameters used in SQL query And it returns an IEnumerable. Example Below code will…
-
Fetching different values in LINQ Concurrency conflict
If you have not read my post Resolving Concurrency conflicts in LINQ then I strongly recommend you to read that. This post is a simple added extension of said post. After reading resolving concurrency conflict in LINQ you are pretty much aware of resolving mechanism of concurrency conflicts. Now assume a requirement that you need…
-
Using O/R designer to bind a Windows Form in LINQ
In this post I will show you, how you could bind a Windows Form with Entity created by O/R designer. Essentially we are going to create a DataSource using generated entity of O/R designer. I assume that, 1. You have created Windows Application project. 2. You have created Datacontext and entity class using LINQ to…
-
Turning off Pluralization of classes in LINQ to SQL O/R designer
In this quick post, I will show you how you could avoid pluralization of classes in LINQ to SQL Step1 Open visual studio and click on Tool from Menu. Then select Options Step 2 Select Database Tools tab Step 3 Now choose O/R designer option from Database tool tab Step 4 Change Enabled to False.…
-
Resolving Concurrency conflicts in LINQ
While performing database operation, one major thing need to be taken care of is Concurrency Conflicts. Concurrency conflict can happen when two sources are try to modify database at the same time. Let us understand conflict in LINQ with an example, From above diagram you can infer that, essentially there are three steps involved in…
-
Logging in LINQ to SQL
It is very common that may come in your mind that, how we can see SQL query being generated at the back end for LINQ query. Assume you have a LINQ as below, If you want to view SQL query generated for above LINQ on console screen you need to add just one line of…