Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

.NET provider ASADbType question

2 posts in General Discussion Last posting was on 2003-04-23 19:14:04.0Z
Bryan Hicks Posted on 2003-04-23 14:19:33.0Z
From: "Bryan Hicks" <bryanh@ungerboeck.com>
Subject: .NET provider ASADbType question
Date: Wed, 23 Apr 2003 09:19:33 -0500
Lines: 24
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Message-ID: <u3TJXPaCDHA.220@forums-1-dub>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: 12.25.248.24
Path: forums-1-dub!forums-master.sybase.com!forums-1-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:925
Article PK: 2941

I am trying to write a data factory class, because the app I am building
must support multiple DB platforms. As such, I have a code to genericly use
.NET interface classes, and convert them into DB specific data adapters and
command objects.

I am currently running into a problem with the ASAParameter object in the
SQL Anywhere .NET managed data provider. Specifically, when my code passes
in a .NET System.Data.DbType object, I have to cast it to an ASADbType
object in order to create a new ASAParameter object. I have noticed that
when I pass in a DBType of Decimal, it is cast into an ASADbType of Double,
even though the ASADbType enumeration contains a Decimal. Why is this?

If I then change the DBType property on the newly created parameter back to
Decimal, an odd behavior occurs. If I update my database using a
ASADataAdapter on a typed DataTable, any modified row that contains a
decimal column that has not been changed (in other words, the row was
modified because of a change to another column on the row) will be saved
with the decimal point being shifted two places to the right. This will
happen every time on any row, until the resulting value becomes too large to
store, at which point I can no longer update the row.

Any suggestions will be greatly appreciated.


Robert Waywell Posted on 2003-04-23 19:14:04.0Z
From: "Robert Waywell" <rwaywell@ianywhere.com>
References: <u3TJXPaCDHA.220@forums-1-dub>
Subject: Re: .NET provider ASADbType question
Date: Wed, 23 Apr 2003 15:14:04 -0400
Lines: 58
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <O9BDqzcCDHA.296@forums-1-dub>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: rwaywell-pc.sybase.com 172.31.143.74
Path: forums-1-dub!forums-master.sybase.com!forums-1-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:928
Article PK: 2942

Please do not cross post. This question has already been responded to on the
sybase.public.sqlanywhere.general newsgroup.

--
-----------------------------------------------
Robert Waywell
Sybase Adaptive Server Anywhere Developer - Version 8
Sybase Certified Professional

Sybase's iAnywhere Solutions

Please respond ONLY to newsgroup

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports: http://casexpress.sybase.com/cx/cx.stm

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

Whitepapers, TechDocs, and bug fixes are all available through the iAnywhere
Developer Community at www.ianywhere.com/developer

"Bryan Hicks" <bryanh@ungerboeck.com> wrote in message
news:u3TJXPaCDHA.220@forums-1-dub...
> I am trying to write a data factory class, because the app I am building
> must support multiple DB platforms. As such, I have a code to genericly
use
> .NET interface classes, and convert them into DB specific data adapters
and
> command objects.
>
> I am currently running into a problem with the ASAParameter object in the
> SQL Anywhere .NET managed data provider. Specifically, when my code
passes
> in a .NET System.Data.DbType object, I have to cast it to an ASADbType
> object in order to create a new ASAParameter object. I have noticed that
> when I pass in a DBType of Decimal, it is cast into an ASADbType of
Double,
> even though the ASADbType enumeration contains a Decimal. Why is this?
>
> If I then change the DBType property on the newly created parameter back
to
> Decimal, an odd behavior occurs. If I update my database using a
> ASADataAdapter on a typed DataTable, any modified row that contains a
> decimal column that has not been changed (in other words, the row was
> modified because of a change to another column on the row) will be saved
> with the decimal point being shifted two places to the right. This will
> happen every time on any row, until the resulting value becomes too large
to
> store, at which point I can no longer update the row.
>
> Any suggestions will be greatly appreciated.
>
>