B
Babu Mannaravalappil
Hi all,
Visual Studio Enterprise 2003 and DotNet Framework 1.1.
I have a strongly typed dataset (generated by the Schema Designer). This
dataset has a table called Category and one of the columns in this table is
called "ParentCategoryId". There are no explicit relationship set between
this column and any other column.
Here are some non-contiguous lines of code:
MainDS.CategoriesRow r = ds.Categories.NewCategoriesRow(); //create a
detached row
r.ParentCategoryId = -1; // set the ParentCategoryId....this is the
problem column
r.CreatedBy = -1; // set the CreatedBy.....this column is
perfectly OK.
ds.Categories.AddCategoriesRow(r); // Add the row to the table.
The problem is when the AddCategoriesRow(r) method is executed, the the
value in ParentCateogyId immediately changes to 1 instead of -1. This only
happens if the value in this column happens to be equal to or less than
zero. Any value < 0 is changed to 1. As long as the value is > 0,
everything works as expected. The "CreatedBy" column is identical in
characteristics to "ParentCategoryId" column. The above problem does not
occur in CreatedBy column. Whatever value I assign to CreatedBy stays put.
But not in ParentCategoyId column. I have tried every trick in the book to
no avail. I even deleted the table from the schema and re-added the same to
force a recompile of the XSD file. The only conclusion I can come to is
that there must be some bug in the framework or the column name
ParentCategoryId is used internally in ADO.NET which is causing some name
conflict or something.
Has anybody ever seen this problem before? Any help is highly appreciated.
Babu.
Visual Studio Enterprise 2003 and DotNet Framework 1.1.
I have a strongly typed dataset (generated by the Schema Designer). This
dataset has a table called Category and one of the columns in this table is
called "ParentCategoryId". There are no explicit relationship set between
this column and any other column.
Here are some non-contiguous lines of code:
MainDS.CategoriesRow r = ds.Categories.NewCategoriesRow(); //create a
detached row
r.ParentCategoryId = -1; // set the ParentCategoryId....this is the
problem column
r.CreatedBy = -1; // set the CreatedBy.....this column is
perfectly OK.
ds.Categories.AddCategoriesRow(r); // Add the row to the table.
The problem is when the AddCategoriesRow(r) method is executed, the the
value in ParentCateogyId immediately changes to 1 instead of -1. This only
happens if the value in this column happens to be equal to or less than
zero. Any value < 0 is changed to 1. As long as the value is > 0,
everything works as expected. The "CreatedBy" column is identical in
characteristics to "ParentCategoryId" column. The above problem does not
occur in CreatedBy column. Whatever value I assign to CreatedBy stays put.
But not in ParentCategoyId column. I have tried every trick in the book to
no avail. I even deleted the table from the schema and re-added the same to
force a recompile of the XSD file. The only conclusion I can come to is
that there must be some bug in the framework or the column name
ParentCategoryId is used internally in ADO.NET which is causing some name
conflict or something.
Has anybody ever seen this problem before? Any help is highly appreciated.
Babu.