Click here to Skip to main content
16,004,587 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have created the form, in that added four buttons namely Add,Edit,Delete,Block.If i'm clicking the add button the add form is diplayed.If i'm clicking Edit button the empty form is displayed for me it should open the form with all details.The same process for edit,delete and block...

Regards
Balamurugan
Posted
Comments
[no name] 4-Oct-12 7:05am    
When i'm clicking the edit button it should bind all the values.For that i need coding...

you can write everything is same to edit,delete but the only changes in cmd line

In page load you have to reterive the data's from table.
C#
SqlCommand cmd=new SqlCommand("select * from UserCreation");

and for edit something you need to update your database with cmd as
C#
SqlCommand cmd=new SqlCommand("update UserCreation set columnname2= '"textbox2.Text'",columnname3='"textbox3.Text'" where columnname1= '"textbox1.Text'" ");

similarly for delete something you also need to delete from database with cmd as
C#
SqlCommand cmd=new SqlCommand("delete from UserCreation where columnname1= '"textbox1.Text'" ");

This is simple model I think you may get some ideas.
 
Share this answer
 
v2
On click of Edit button its displyainng empthy form because page is post back .so on click of Edit button u should bind your data with controls .
 
Share this answer
 
Comments
[no name] 4-Oct-12 7:05am    
When i'm clicking the edit button it should bind all the values.For that i need coding...
solanki.net 4-Oct-12 7:14am    
can i show your code what r u writing on click of Add button ?
solanki.net 4-Oct-12 7:32am    
k, Now on Edit button click event u should hit database for getting result(select * from tableName) and from front end u will have to send id(id of record that u want to edit ) .according to that id u will get datatable .
then u can bind your controls with table columns.
[no name] 4-Oct-12 7:36am    
I can't get ur answer could u explain clearly...
[no name] 4-Oct-12 7:41am    
could u explain with the coding....

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