i have not declared any primary key of table and I want to delete row using gridview or formview. Is it possible?
I have not declare any primary key of the table and I want to delete row using gridvi
Collapse
X
-
You need to find the row that matches the one that the user selected to delete. Use the SQL "WHERE" Clause to help you with this.
For example, if a First Name, Middle Name and Last Name makes a unique key to identify someone you could have something like:
You may need to use more than 3 fields to ensure that you are deleting the right record...this is why unique identifiers are easier to use (as veenna suggested)Code:DELETE FROM Persons WHERE FirstName='John' AND MiddleName='Jayne' AND LastName='Doe'
-FrinnyComment
Comment