I have two tables
Inbox(id,accountid,emailfrom,emailsubject,emailbody,emaildate,attachment)
Trash(as above)
When a user wants to delete a row from the inboxDataGridView
, first that row is copied to the trash
table. I'm trying this query to copy the row first:
string query = "INSERT INTO Trash(inboxid, accountid, emailfrom, subject, emailbody,emaildate,attachment) SELECT inboxid, accountid, emailfrom, subject, emailbody,emaildate,attachment FROM Inbox WHERE(inboxid = " + accountinfo.PEmailId + ")";(where accountinfo.PEmailId = selectedRow value
but this query gives me an error.
Kindly guide me on how I can do it, copy and remove.