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.

RE: Weird problem in dataset - Bug? by JTnospamverizonnet

JTnospamverizonnet
Wed Sep 29 13:33:02 CDT 2004

Hi,
What is the type of your ParentCategoryId column? Is it by chance
UnsignedInt?
JT

"Babu Mannaravalappil" wrote:

> 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.
>
>
>

Re: Weird problem in dataset - Bug? by Babu

Babu
Thu Sep 30 11:49:21 CDT 2004

Thanks for the reply JT. No, the datatype is not Unsigned, it is decimal.
The weird part is, I have other columns of the same type and same data going
in and out. The problem happens only on the ParentCategoryId column.
Since I could not fix it, I simply changed the name of the column from
"ParentCategoryId" to "ParentId" (all other characteristics of this column
including the datatype remains the same) both in the Database table and the
Dataset table. Now everything is working fine.
But I would still like to know, why it did not work when the name of the
column was ParentCategoryId.

Babu.

"Babu Mannaravalappil" <babupalladium1@yahoo.com> wrote in message
news:eAQnyokpEHA.536@TK2MSFTNGP11.phx.gbl...
> 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.
>
>