문제

In my application the following code not saving the data back to the database

this.lMSData.publisher.AddpublisherRow(txtname.Text, txtcondact.Text, txtmobile.Text);
this.lMSData.publisher.AcceptChanges();

I also used lmsData.AcceptChanges().. but its not worked, i noticed that i can update and delete the rows and save back to the database without any errors. but i cant add the data

도움이 되었습니까?

해결책

AcceptChanges does not save data back to the database - to do that, you need to call the update method on your tableadapter/dataadapter. Datasets are 'rollbackable'. All the changes you make can be reversed by calling RejectChanges, (whereupon any Added rows will be removed, and rows marked Modified or Deleted will be returned to how they were); or committed by calling AceptChanges, whereupon the new data becomes the current data. The data is still only in the dataset at this point though - until you call Update.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top