In that snippet, the DataSet comes from session. When is it set ?
You certainly can use a DataSet in a WinForms application. Is it the databinding, you are having trouble with ?
In that snippet, the DataSet comes from session. When is it set ?
You certainly can use a DataSet in a WinForms application. Is it the databinding, you are having trouble with ?
Your problem is likely here:
if (confirmChanges == DialogResult.Yes)
{
_personInfo.AcceptChanges();
ConnectBLL.BLL.Person.Update(_personInfo);
}
AcceptChanges sets the RowState to Unchanged on all rows that were ready to be updated. Frankly, it'd probably be better to use whatChanged as that'll keep your adapter from having to re-check for changed rows.
if (confirmChanges == DialogResult.Yes)
{
ConnectBLL.BLL.Person.Update(whatChanged);
_personInfo.AcceptChanges();
}
First,
If you want a good explanation of the issue that Jacob raised read the following article...
http://www.knowdotnet.com/articles/datasetmerge.html
And I agree with the others that you seem to be making it harder than it needs to be.
You are not clear what the ConnectBLL class is...is that a custom bizness object or a strongly typed dataset.
To do databinding which will automatically save would be a very long post so in lieu of that here are a couple of links.
http://www.codeguru.com/columns/vb/article.php/c10815
http://support.microsoft.com/kb/313482
http://msdn.microsoft.com/en-us/library/aa984336(VS.71).aspx
Those were the first links I found on google using (step by step instruction on winforms databinding with a strongly typed dataset) as the search string. You might find a better one. The codeguru link looked pretty good. The other to are more thorough at the expense of being more technical.
Best of all...if you can spring for Chris Sells book in winforms development, the chapters on data binding are excellent (along with all of the other chapters.)
Hope this helps.