Update table in database through datagridview in winform
Discuss Update table in database through datagridview in winform in the .Net Development forum on Dev Shed. Update table in database through datagridview in winform .NET development forum discussing all .NET derivatives including C#, VB.NET, ASP.NET, ADO.NET and more. Learn the ins and outs of using the .NET framework.
Posts: 2
Time spent in forums: 30 m 38 sec
Reputation Power: 0
Update table in database through datagridview in winform
Hi all,
Please help me in solving following query:
I want to update table at backend in database throughmakeing changes in datagridview.
What I want is, when User makes changes in datagridview and clicks save or update button, the changes which are made in datagridview should get reflect in table in databse.
For ex:
I am having "Datagridview", "Edit" and "Save" button on WinForm and table "EmpDetails" at backend in databse. I am filling "Datagridview" with table "EmpDetails". When user clicked "Edit" button he should allowed to make changes in "Datagridview". After making changes in "Datagridview" when user clicked "Save" button, whichever changes made in datagridview should get reflect at backend in table "EmpDetails".
Posts: 2
Time spent in forums: 30 m 38 sec
Reputation Power: 0
In case of joins in dataset what is the solution
Thanks
It is working fine if there is single table in dataset.
But in my dataset there are 4 table with join (i.e. to fill datagrid I am combining data from 4 tables by using joins). So what should I do in this case?
If your DataSet or your Database enforce some Relations you have to call the Fill and Update methods accordingly.
I also had the problem of errors occuring when i altered the primary key of a line in the dataset. That can be solved by making the primaryKey column uneditable.