Home All Groups Group Topic Archive Search About

table structure - wrong columns being called

Author
22 Aug 2006 7:15 AM
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?


Author
22 Aug 2006 2:38 PM
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" <u16975@uwe> schreef in bericht
news:65234fa3ce22d@uwe...
Show quoteHide quote
> 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?
>
> --
> Message posted via DotNetMonster.com
> http://www.dotnetmonster.com/Uwe/Forums.aspx/dotnet-vb-net/200608/1
>