February 29, 2008 at 9:51 am
I use VS2003 and have added a Windows form using the Data Form Wizard. This creates my form with all of the elements mapped to TextBoxes. I add a sqldataadapter and change the code to use the sql connection and not the odbc. This is working on numerous forms. I now have a form with about 30 elements. I can load and modify existing data, but cannot Add new rows. The code uses these lines:
BindingContext (Dataset, "Tablename").EndCurrent
BindingContext (dataset, "Tablename").AddNew
The text boxes should clear when it goes to a new row in the dataset. From the position display label (auto generated by the wizard) I can see that a new row is created because it is showing I am looking at 1 of 2. It should move to 2 of 2 and let me enter new data and then use the Update button to write to the database. I have changed the data to a subset of what I need and it works, like all of my other forms. I have renamed all of the elements, created new tables, created new datasets from what was automatically created for the odbc connection and just about pulled out all of my hair trying to figure out what is happening.
Anyone know what is going on????
March 5, 2008 at 11:12 am
This problem is due to a Microsoft Bug! I saw some reference to a bug on one of the other posts, but it didn't seem to fit. The bug is that the BindingContext process does not work WHEN there are CheckBox elements on the form. Does not come up when searching or even on the MSDN site, unless you put the specific circumstances in the search parameters. Very frustrating week+ to find and get the work-around.
This Post is Closed. Problem solved.:D
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply