C datagridview not updating database

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.

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.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.I simply want to iterate through the rows of the dgv do some alterations and save the data. Button Click example snippet follows: Thanks Bob foreach (Data Grid View Row n in V1. The problem is I need the sort to work out the alterations. Bob "Bob" Hi, Frame Work 2.0 Quick and dirty job so I thought I would do it all on the UI as quick and easy as possible. I then used the same methodology to create a dgv based on the table underlying the Access query Its Table Adapter does expose the update method. Allowedit property shows true If you are using SQL Express, make sure you are updating the right copy of the database. ---------------------------------------------- "Chris" Hi, The underlying System Generated table adapter is not exposing an updatemethod.I got the datagridview to display my Access databaseview by using the Datasources and dragging the exposed view onto the datagrid as per the save the data. Button Click example snippet follows: Thanks Bob foreach (Data Grid View Row n in V1. The problem is I need the sort to work out the alterations. Bob "Bob" Hi, Frame Work 2.0 Quick and dirty job so I thought I would do it all on the UI as quick and easy as possible. I then used the same methodology to create a dgv based on the tableunderlying the Access query Its Table Adapter does expose the update method.

Hi, Frame Work 2.0 Quick and dirty job so I thought I would do it all on the UI as quick and easy as possible.

Please or register to post comments
If spammers comment on your content, only you can see and manage such comments Delete all

C datagridview not updating database introduction

C datagridview not updating database

Recent posts

04-Dec-2018 05:05
04-Dec-2018 08:15
05-Dec-2018 06:56
05-Dec-2018 11:22