G
Guest
I have a tabbed form that contains data in a similar style to the Add/Edit Contact form from Outlook.
The data is read in using a dataAdapter and fed into a strongly typed dataset.
The dataset contains at present 7 tables, that are linked by various dataRelations.
I can quite happily view details of individual contacts, and see rows from child tables etc.
However, when I try and add a new row to the dataset and change the BindingContext to display it in my form, I get the following error:
System.ArgumentException: Cannot create a child list for field customersiteid
CustomerSiteID is the primary key for the table I am attemptimg to add a row to in the dataset.
The code I am using to add the row and update the binding position is as follows:
CustomerSiteFormDataSet.customersiteRow newRow = this.customerSiteFormDataSet.customersite.NewcustomersiteRow();
this.customerSiteFormDataSet.customersite.AddcustomersiteRow(newRow);
this.BindingContext[this.customerSiteFormDataSet, "customersiteid"].Position++;
I have set the primary key of the datatable to be autoincrementing. The actual insert to the table seems to work fine, it is only when I attempt to look at the new row that the exception occurs. I can see the table row count increasing as it should.
This sounds like such a simple thing, but I am new to dat binding and am stumped.
Thanks
The data is read in using a dataAdapter and fed into a strongly typed dataset.
The dataset contains at present 7 tables, that are linked by various dataRelations.
I can quite happily view details of individual contacts, and see rows from child tables etc.
However, when I try and add a new row to the dataset and change the BindingContext to display it in my form, I get the following error:
System.ArgumentException: Cannot create a child list for field customersiteid
CustomerSiteID is the primary key for the table I am attemptimg to add a row to in the dataset.
The code I am using to add the row and update the binding position is as follows:
CustomerSiteFormDataSet.customersiteRow newRow = this.customerSiteFormDataSet.customersite.NewcustomersiteRow();
this.customerSiteFormDataSet.customersite.AddcustomersiteRow(newRow);
this.BindingContext[this.customerSiteFormDataSet, "customersiteid"].Position++;
I have set the primary key of the datatable to be autoincrementing. The actual insert to the table seems to work fine, it is only when I attempt to look at the new row that the exception occurs. I can see the table row count increasing as it should.
This sounds like such a simple thing, but I am new to dat binding and am stumped.
Thanks