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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Pankaj Kumar ChoudharyPosted Apr 6, 2015, 10:20 PM
and save your table ctrl +s hope it will work for you..
Eric SebastianPosted Apr 6, 2015, 9:17 PM
Pankaj Kumar ChoudharyPosted Apr 6, 2015, 9:36 AM
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...
g sPosted Apr 6, 2015, 9:21 AM
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
Gowtham RajamanickamPosted Apr 6, 2015, 4:28 AM
Gowtham RajamanickamPosted Apr 6, 2015, 4:27 AM
Tom MohanPosted Apr 6, 2015, 3:34 AM
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 .
Eric SebastianPosted Apr 6, 2015, 3:18 AM
Riddhi ValechaPosted Apr 1, 2015, 5:54 AM
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 ShanuPosted Apr 1, 2015, 4:39 AM
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/