User ID, First Name and Last Name are template columns and Edit and Delete columns are Command Columns which are added using smart tag option (You can view the smart tag if you right click on the Grid View control).string str Connection = "Server=abc\SQLEXPRESs; Database=Employee; Trusted_Connection=True"; Sql Connection con = new Sql Connection(str Connection); con.Here’s a quick and easy process to get started doing that.I’m assuming that you already have some sort of working database, and that you’ve created a Data Context (i.e. (You know, dragging and dropping those tables, which just takes much work.) If you didn’t know what all was going on in the background, then I don’t blame you.These are the tools that provide data to the data bound controls and support execution of operations like insertions, deletions, sorting, and updates.
There are several ways to perform these operations, I am using the simplest approach.
It’s pretty good for testing purposes, or really small projects, but if you’re doing anything that is going to grow / is large already, then you’ll probably not want all that logic embedded in your pages.
As I became more comfortable with LINQ, I decided to take on the task of switching over to the Object Data Source to bind to my List Views.
The short version of it is that it’s generating a bunch of classes to match the tables in the database.
It’s pretty awesome if you ever get into the details, but for the purposes of this tutorial, we’ll just stick to that. That allows us to mark the class as a Data Object, which just organizes it better and makes the data source wizard easier to work with.