table structure - wrong columns being called

  • Thread starter L&G via DotNetMonster.com
  • Start date
L

L&G via DotNetMonster.com

hi.

ive 3 tables in my access database file. table people [column name "cust"] to
table sales [column name "cus2] is a one to many relationship, and the same
goes for Table sales [column name "salesinv"] and Table receipt [column name
"sinv2"].

i find that in my initial dataset (ds) everythings fine - the rows are
properly linked and displayed in my datagrid. however when i clear the
dataset and the data relations and then try to load only particular rows in
my second form, the program seems to be creating a nonexistent column "cus2"
for my table receipt, and it insists that it wont update my new row for table
receipt properly because:

System.InvalidOperationException : Missing the DataColumn "cus2" in the Data
Table 'receipt' for the Source Column "cus2"
at System.Data.Common.DbDataAdapter.Update(DataRow[] DataRows,
DataTableMapping tableMapping)
at System.Data.Common.DbDataAdapter.Update(DataSet [] dataset, String
srcTable)

cus2 was never part of receipt. its a column in sales. however in the same
event handler im able to properly add a record for the sales table.

what do i do please? why is this happening?
 
C

Cor Ligthert [MVP]

Hi,
dataset and the data relations and then try to load only particular rows in
my second form, the program seems to be creating a nonexistent column
"cus2"

is the "my second form" a typo, or an existing form. If it is the second
table, than I cannot understand it either, but better than now.

Cor


L&G via DotNetMonster.com said:
hi.

ive 3 tables in my access database file. table people [column name "cust"]
to
table sales [column name "cus2] is a one to many relationship, and the
same
goes for Table sales [column name "salesinv"] and Table receipt [column
name
"sinv2"].

i find that in my initial dataset (ds) everythings fine - the rows are
properly linked and displayed in my datagrid. however when i clear the
dataset and the data relations and then try to load only particular rows
in
my second form, the program seems to be creating a nonexistent column
"cus2"
for my table receipt, and it insists that it wont update my new row for
table
receipt properly because:

System.InvalidOperationException : Missing the DataColumn "cus2" in the
Data
Table 'receipt' for the Source Column "cus2"
at System.Data.Common.DbDataAdapter.Update(DataRow[] DataRows,
DataTableMapping tableMapping)
at System.Data.Common.DbDataAdapter.Update(DataSet [] dataset, String
srcTable)

cus2 was never part of receipt. its a column in sales. however in the same
event handler im able to properly add a record for the sales table.

what do i do please? why is this happening?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top