I have used data source control many times and its great it provides us great features for declarative binding. LinqDataSource Control is a great control and it allows us to bind linq queries without writing any code declaratively. Let's create a example in that example I am not going to write a single line of code and we are going to create view,Update and Delete functionality.
So first we need a table which will have data. So, I am going to use the same table which I have used in my old posts. Below is the table structure for this example.
Let's insert some data for that table structure. I have already inserted it in previous example. Just like below.
Now, To bind a linqdatasource we need a Linq-To-SQL Data context class Let's create it via Project->Right Click->Add New Item ->Go to data tab->Linq-To-SQL classes Just like following.
After that I have just dragged user data to my data context just like following.
After creating Our Linq-To-SQL Classes Let's just Add the A grid View control to my default.aspx page and apply some some default format like this.
Now Let's add a LinqDataSource from the toolbox like following.
Now select the data source and click configure data source as we can see as below.
After clicking on the Configure Data source a wizard will appear which will allow us to select
View Complete Post