Delete Database on Gridview ASP.net
Is It Possible To Delete A Record On A Gridview But When We Open At The Database , It Still Has It's Data, Is It Possible To Do That ? If Possible please Reply me Fast, it's Urgent, THANK YOU
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Riddhi ValechaRank #794 · 2.9K reputationPosted Apr 1, 2015, 1:54 AM EDT
I would suggest..... do soft delete of records in database..
Eg - Keep a column -"IsDeleted" or "Flag" with datatype - bit in the database.
1 ==> true ==> Active records.
0 ==> false ==> InActive Records.
While loading, fire the query - "select * from tablename where flag = 1"
While deleting , fire query - "update tablename set flag = 0 where ID = 1"
---------
This will keep a history of all records.
This can help in future also.
Syed ShanuRank #87 · 23.7K reputationPosted Apr 1, 2015, 12:39 AM EDT
http://www.c-sharpcorner.com/UploadFile/asmabegam/insert-select-update-delete-in-Asp-Net-with-simple-login/
http://www.aspsnippets.com/Articles/GridView-CRUD-Select-Insert-Edit-Update-Delete-using-Single-Stored-Procedure-in-ASPNet.aspx
http://www.c-sharpcorner.com/uploadfile/raj1979/select-add-update-and-delete-data-in-a-Asp-Net-gridview-control/
Eric Sebastian27 reputationPosted Apr 5, 2015, 11:18 PM EDT
Tom MohanRank #912 · 2.3K reputationPosted Apr 5, 2015, 11:34 PM EDT
Get the primary key(or any unique filed) of the record from gridview during deletion. Call you sql query(Delete from table where column=key) and commit transaction .
Gowtham RajamanickamRank #57 · 29K reputationPosted Apr 6, 2015, 12:27 AM EDT
Gowtham RajamanickamRank #57 · 29K reputationPosted Apr 6, 2015, 12:28 AM EDT
g s102 reputationPosted Apr 6, 2015, 5:21 AM EDT
Explain Below Links
http://dotnetdrizzles.blogspot.in/2014/09/insertupdatedelete-in-gridview-using.html
http://screenshotdrizzles.blogspot.in/2014/10/insertupdatedelete-in-gridview-using.html
Pankaj Kumar ChoudharyRank #80 · 24.4K reputationPosted Apr 6, 2015, 5:36 AM EDT
when you binding the data to gridview then you can select all data from table where _Isdeleted is equal to "1". when you delete an data from gridview then you can set this column to "0".
such that data will be remove from gridview and also remain save in table...
Eric Sebastian27 reputationPosted Apr 6, 2015, 5:17 PM EDT
Pankaj Kumar ChoudharyRank #80 · 24.4K reputationPosted Apr 6, 2015, 6:20 PM EDT
and save your table ctrl +s hope it will work for you..