Introduction :
Here I explain how to insert, edit, update and delete data in grid view using asp.net.
In this project I use some grid view events those are
1) Onrowcancelingedit
2) Onrowediting
3) Onrowupdating
4) Onrowcancelingedit
5) Onrowdeleting
In this grid view I need to write code to insert data into grid view after that I need to edit that grid view data and update it and if I want to delete the data in grid view we need to delete this record simply by click on delete button of particular row.Here I explain full procedure step by step
Step 1: create a connection string in web.config page
<connectionStrings>
<add name="conn" providerName="System.Data.SqlClient"
connectionString="Data Source=Sk-Pc;uid=sa;pwd=12345;database=droplist"></add>
</connectionStrings>
<add name="conn" providerName="System.Data.SqlClient"
connectionString="Data Source=Sk-Pc;uid=sa;pwd=12345;database=droplist"></add>
</connectionStrings>
Step 2: create database
set primary key column ID and auto increment by +1 using sql properties
Thank you so much for this code .., is very useful for me
ReplyDeleteThis comment has been removed by the author.
ReplyDeletevery useful for my project....thanx
ReplyDeleteIts very good
ReplyDeleteThis code is very useful for me
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteCode is very useful its great
ReplyDelete