Академический Документы
Профессиональный Документы
Культура Документы
Net
Linq to
DB StoreProcedure
Its the simplest process in LINQ. First you add LINQ To SQL class and Its extension is .dbml. It will ask you to added into App_Code folder in Solution Exploler and Click on OK Button.
Now, Drag and drop tables and stored procedures on dbml page.
Drage stored procedures in this part like insert,delete,update,display etc. Drage the table here.
This designed page generates designer.cs class automatically. You just use that class to access the functionalty on your aspx.cs page. You have to create the object of class in .aspx page. With the help of object, access the functions named as stored procedures and pass parameters and get records from database. You can do all operations like insert,delete,update,retrive data using LINQ.
Step2:Field Window will be open and select CommandField from list and click on Add Button. Step3: In the command Field, Show SelectButton set true. Select Button will be displayed in gridview. Step4:In SelectedIndexChanged event, type code Step5:In code, GridView1.SelectedDataKey.Value is used to access the EmpId or value of any column. Step6: DataKeyNames property of Gridview should be set With column like EmpId.