Click here to Skip to main content
15,898,222 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
I have a windows form application where i have displayed the table employee details in a datagrid and i have a delete button while selecting a row and clicking on delete button that row should be deleted based on employee id.I have created a stored procedure for delete and a class file where i have delete function could you please guide after that
Posted
Comments
Shahin Khorshidnia 10-Jun-12 11:05am    
Why don't you rebind the new data collection to the datagrid?

 
Share this answer
 
Comments
VJ Reddy 14-Jun-12 13:27pm    
Helpful references. 5!
Maciej Los 14-Jun-12 14:00pm    
Thank you, VJ ;)
What further guidance you need?

Steps further:
1. On delete click, pass on the selected row's EmployeeId to DB layer (if no DB layer, ok. Just keep a note of this ID)
2. Prepare a SQL query that will update your database. Use the EmployeeId you have in your WHERE clause
3. Once executed, refresh your grid with data - either rebind your grid or remove the row from display for the time being

Try!
 
Share this answer
 
Comments
Maciej Los 10-Jun-12 17:34pm    
Good point, my 5!
Sandeep Mewara 11-Jun-12 1:51am    
Thanks losmac.
Saroj Kumar Sahu 11-Jun-12 8:26am    
also 5 from me.
Sandeep Mewara 11-Jun-12 9:11am    
Thanks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900