In my previous project, I implemented the same architecture and .NET 2.0 provides the The following two functions load the data and bind it to a Data Grid View.
That can be solved by making the primary Key column uneditable. Tables; //now u can save changes to back end with da.
Use this code to populate datagridview Sql Data Adapter da=new Sql Data Adapter("select * from product",strcon); Sql Command Builder cb=new Sql Command Builder(da); Data Set ds = new Data Set(); da.
to fill datagrid I am combining data from 4 tables by using joins). Thanks & regards, Swapnil If your Data Set 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.
For ex: I am having "Datagridview", "Edit" and "Save" button on Win Form and table "Emp Details" at backend in databse.
I am filling "Datagridview" with table "Emp Details".
The application uses an async calling mechanism to make database calls.
Because the SQLEnumerator does not supporting async calling, I have added delegates to call those methods asynchronously. NET 2.0, Sql Command object supports async calling to the database.
Use this code to populate datagridview Sql Data Adapter da=new Sql Data Adapter("select * from product",strcon); Sql Command Builder cb=new Sql Command Builder(da); Data Set ds = new Data Set(); da. Update(ds); Thanks It is working fine if there is single table in dataset.
But in my dataset there are 4 table with join (i.e.
When you start reading the code from the beginning, there is an when making calls to the SQL server list, databases, and tables.