Gridview code for insert,delete,update

Posted by Raghu16 under ASP.NET on 11/15/2011 | Points: 10 | Views : 3570 | Status : [Member] | Replies : 2
Here i have taken gridview in the design by using the gridvew task add new column i have generated delete,update,insert buttons by using the datasource i have written command for delete,update,insert as
DeleteCommand="DELETE FROM Empdetails WHERE (Empname =raghu)";and

UpdateCommand="UPDATE Empdetails SET Empid = 1865201, Empname = 'Reddy' WHERE (Empid = 1865200)"

by doing this it is deleting,updating only particular Empid but i need code for deleting all the records,and updating all the records where we click the update any button in the row of gridview


the code which i need is only for in gridview delete,update ,insert buttons
for example
here
gridview in this
empname|empid|city|
raghu |18652|hyd| Delete(button)|Update(button)|insert(button)
ram |1547 |hyd|Delete(button)|Update(button)|insert(button)

like i have records and delete,update,insert buttons
here i need code for only clicking the update in every row it should upadte,simillarly delete ,insert buttons also




Responses

Posted by: Sksamantaray on: 1/10/2012 [Member] Silver | Points: 25

Up
0
Down
Go through this link once(By Sheonarayan):
http://www.dotnetfunda.com/articles/article1655-22-gridview-tips-and-tricks-by-sheo-narayan.aspx

Thanks,
Sanjay

Raghu16, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Self-innovator on: 1/11/2012 [Member] Bronze | Points: 25

Up
0
Down
Go through this link
http://www.aspdotnet-suresh.com/2011/02/how-to-inserteditupdate-and-delete-data.html

Join Hands Change lives
Thanks & Regards
Straight Edge Society

Raghu16, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response