Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All...

I am new to programming..

please help me in the following problem which i am facing in C# and SQL server as backend.

1) How to delete the record from the grid view and update the database.

2) How to refresh the gridview.

3) how to update the gridview


please help me for the same..


Thanks...
Posted
Comments
Oshtri Deka 28-Sep-12 3:22am    
You should really try Google first.

Try the following link
this is a simple to understand.........

Insert, Update, Delete with Gridview ... Simple Way[^]
 
Share this answer
 
Comments
Oshtri Deka 28-Sep-12 3:18am    
Good link.
ridoy 28-Sep-12 3:25am    
+5
there r many ways so tell me that when u r hitting database i mean every time after deleting record or only once when u click on save button .
 
Share this answer
 
Comments
zaid Qureshi 28-Sep-12 3:10am    
i didnt get u bro..@solanki
Oshtri Deka 28-Sep-12 3:19am    
This is not correct place for l33t
zaid Qureshi 28-Sep-12 3:26am    
Oshtri Deka : whats that l33t
i mean when u want to delete the record from database after click the delete button of grid or anything else .
 
Share this answer
 
Comments
zaid Qureshi 28-Sep-12 5:03am    
yes..after clicking the delete Button from the grid
solanki.net 28-Sep-12 5:15am    
it means every time after deleting record from grid u will have to hit database .
on rowDeleting event find id of row like that :
Label lblid = (Label)gvHardware.Rows[e.RowIndex].FindControl("lblId");
send this id with special parameter(like "Delete") and check in database value of special parameter and delete record using id .
after deleting record again u will have hit database for binding grid .
zaid Qureshi 28-Sep-12 5:25am    
@ solanki:just give an example plz...

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