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.

Urgent...I think there is a bug in ASA .Net Provider!!!

3 posts in General Discussion Last posting was on 2003-05-28 16:01:19.0Z
Steve Pasha Posted on 2003-05-27 17:13:38.0Z
From: "Steve Pasha" <spasha@sencosystems.com>
Subject: Urgent...I think there is a bug in ASA .Net Provider!!!
Date: Tue, 27 May 2003 10:13:38 -0700
Lines: 54
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Message-ID: <eEzxRPHJDHA.221@forums-1-dub>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: ip68-5-204-45.oc.oc.cox.net 68.5.204.45
Path: forums-1-dub!forums-master.sybase.com!forums-1-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:1086
Article PK: 3032

Hi,

It appears that there is a bug in the ASA .Net provider. Here is the code:

'****************************************
Dim param as AsaParameter
Dim intAddressId as New System.Data.SqlTypes.SqlInt64 (1)
Dim ds as dataset

param = New iAnywhere.Data.AsaClient.AsaParameter("@address_id",
iAnywhere.Data.AsaClient.AsaDbType.BigInt)
param.Value = intAddressId

ds = SqlHelper.ExecuteDataset(_AsaTransaction, CommandType.StoredProcedure,
"p_address_s", param)
'****************************************

Once I execute this I get the following message: "Specified cast is not
valid"

Here is the stack trace:
" at System.Convert.ToInt64(Object value)
at iAnywhere.Data.AsaClient.AsaDataConvert.DotNetToAsa(Object valIn,
AsaDbType asaDbType, Int32 size, Int32 offset)
at
iAnywhere.Data.AsaClient.AsaParameterCollection.GetParameterInfo(Int32&
count, AsaParameterDM** ppParmsDM)
at iAnywhere.Data.AsaClient.AsaCommand.BindParameters()
at iAnywhere.Data.AsaClient.AsaCommand.PreExecute()
at iAnywhere.Data.AsaClient.AsaCommand._ExecuteReader(CommandBehavior
commandBehavior)
at iAnywhere.Data.AsaClient.AsaCommand.ExecuteReader()
at iAnywhere.Data.AsaClient.AsaDataAdapter.OpenDataReader(Boolean
schemaOnly, Boolean& closeConnection)
at iAnywhere.Data.AsaClient.AsaDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable)
at iAnywhere.Data.AsaClient.AsaDataAdapter.Fill(DataSet dataSet)
at Senco.DatabaseAccess.Asa.SqlHelper.ExecuteDataset(AsaTransaction
transaction, CommandType commandType, String commandText, AsaParameter[]
commandParameters) in
C:\Proj\Dev\Common\DataAccess_iAnywhere\SqlHelper.vb:line 544
at Senco.DIS.DataAccessLayer.Address.Delete(Transaction trxSenco,
addressRow tdsAddress) in
C:\Proj\Dev\Senco.DIS.DataAccessLayer\Address.vb:line 96
at Senco.DIS.BusinessLogicLayer.Address.Save(Transaction trxSenco,
xsdAddress tdsAddress) in
C:\Proj\Dev\Senco.DIS.BusinessLogicLayer\Address.vb:line 55"

Here is my environment:
Windows XP Service Pack 1
SqlAnywhere Version 8.0.2.4251
Visual Studio 2003 (.Net Framework 1.1)


Robert Waywell Posted on 2003-05-28 15:03:39.0Z
From: "Robert Waywell" <nospam_rwaywell@ianywhere.com>
References: <eEzxRPHJDHA.221@forums-1-dub>
Subject: Re: Urgent...I think there is a bug in ASA .Net Provider!!!
Date: Wed, 28 May 2003 11:03:39 -0400
Lines: 85
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: <eo6FBtSJDHA.275@forums-2-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-2-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:1091
Article PK: 3027

Bug reports can be submitted free of charge using the link below. Since this
is an urgent issue for you, you will likely prefer to open a case with Tech
Support so that we can work with you to address the problem.

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

"Steve Pasha" <spasha@sencosystems.com> wrote in message
news:eEzxRPHJDHA.221@forums-1-dub...
> Hi,
>
> It appears that there is a bug in the ASA .Net provider. Here is the
code:
>
> '****************************************
> Dim param as AsaParameter
> Dim intAddressId as New System.Data.SqlTypes.SqlInt64 (1)
> Dim ds as dataset
>
> param = New iAnywhere.Data.AsaClient.AsaParameter("@address_id",
> iAnywhere.Data.AsaClient.AsaDbType.BigInt)
> param.Value = intAddressId
>
> ds = SqlHelper.ExecuteDataset(_AsaTransaction,
CommandType.StoredProcedure,
> "p_address_s", param)
> '****************************************
>
> Once I execute this I get the following message: "Specified cast is not
> valid"
>
> Here is the stack trace:
> " at System.Convert.ToInt64(Object value)
> at iAnywhere.Data.AsaClient.AsaDataConvert.DotNetToAsa(Object valIn,
> AsaDbType asaDbType, Int32 size, Int32 offset)
> at
> iAnywhere.Data.AsaClient.AsaParameterCollection.GetParameterInfo(Int32&
> count, AsaParameterDM** ppParmsDM)
> at iAnywhere.Data.AsaClient.AsaCommand.BindParameters()
> at iAnywhere.Data.AsaClient.AsaCommand.PreExecute()
> at iAnywhere.Data.AsaClient.AsaCommand._ExecuteReader(CommandBehavior
> commandBehavior)
> at iAnywhere.Data.AsaClient.AsaCommand.ExecuteReader()
> at iAnywhere.Data.AsaClient.AsaDataAdapter.OpenDataReader(Boolean
> schemaOnly, Boolean& closeConnection)
> at iAnywhere.Data.AsaClient.AsaDataAdapter.Fill(DataSet dataSet, Int32
> startRecord, Int32 maxRecords, String srcTable)
> at iAnywhere.Data.AsaClient.AsaDataAdapter.Fill(DataSet dataSet)
> at Senco.DatabaseAccess.Asa.SqlHelper.ExecuteDataset(AsaTransaction
> transaction, CommandType commandType, String commandText, AsaParameter[]
> commandParameters) in
> C:\Proj\Dev\Common\DataAccess_iAnywhere\SqlHelper.vb:line 544
> at Senco.DIS.DataAccessLayer.Address.Delete(Transaction trxSenco,
> addressRow tdsAddress) in
> C:\Proj\Dev\Senco.DIS.DataAccessLayer\Address.vb:line 96
> at Senco.DIS.BusinessLogicLayer.Address.Save(Transaction trxSenco,
> xsdAddress tdsAddress) in
> C:\Proj\Dev\Senco.DIS.BusinessLogicLayer\Address.vb:line 55"
>
> Here is my environment:
> Windows XP Service Pack 1
> SqlAnywhere Version 8.0.2.4251
> Visual Studio 2003 (.Net Framework 1.1)
>
>


Jason Hinsperger Posted on 2003-05-28 16:01:19.0Z
From: "Jason Hinsperger" <NOJason_HinspergerSPAM@hotmail.com>
References: <eEzxRPHJDHA.221@forums-1-dub> <eo6FBtSJDHA.275@forums-2-dub>
Subject: Re: Urgent...I think there is a bug in ASA .Net Provider!!!
Date: Wed, 28 May 2003 12:01:19 -0400
Lines: 134
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <OJ72iLTJDHA.221@forums-1-dub>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: hinsperg-pc1.sybase.com 172.31.143.226
Path: forums-1-dub!forums-master.sybase.com!forums-1-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:1097
Article PK: 3373

FYI, here is a brief summary of what we have found in relation to Steve's
question:
There is a problem in the sample code. The AsaParameter's value is set to
a SqlInt64. The AsaClient calls the System.Convert.ToInt64 to convert the
SqlInt64 to Int64, but the System.Convert can't convert a SqlInt64 to
Int64. Then an InvalidCastException is thrown.

If you search MSDN, you will find the SqlInt64 is defined in
System.Data.SqlTypes namespace which provides classes for native types
within SQL Server. Only SqlClient supports these types, the other .NET
providers( OleDb provider, Odbc provider, AsaClient...) do not support these
types. Using an Int64 should work.

The type of AsaParameter.Value is object, so you can also define an object
variable. Fox example:
object address_id = null; // or a Int64 value
AsaParameter parm = new AsaParameter();
parm.AsaDbType = AsaDbType.BigInt;
parm.Value = address_id;


If you have 4 parameters in your SQL command, you should create 4
AsaParameter objects. The AsaParameter has many properties. Essentially, you
need to specify the AsaDbType(or DbType) property which can be an AsaDbType
value. For input parameters, you also need to provide a value which is an
object. The AsaClient needs to cast the value( object ) to some internally
data before sending the command to the engine. Sometimes, the cast might be
invalid. For example, if you set AsaDbType to UniqueIdentifier and set value
to an int16, you will get an exception.7


--
Jason Hinsperger
International and Sustaining Engineering
iAnywhere Solutions

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

"Robert Waywell" <nospam_rwaywell@ianywhere.com> wrote in message
news:eo6FBtSJDHA.275@forums-2-dub...
> Bug reports can be submitted free of charge using the link below. Since
this
> is an urgent issue for you, you will likely prefer to open a case with
Tech
> Support so that we can work with you to address the problem.
>
> --
> -----------------------------------------------
> 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
>
> "Steve Pasha" <spasha@sencosystems.com> wrote in message
> news:eEzxRPHJDHA.221@forums-1-dub...
> > Hi,
> >
> > It appears that there is a bug in the ASA .Net provider. Here is the
> code:
> >
> > '****************************************
> > Dim param as AsaParameter
> > Dim intAddressId as New System.Data.SqlTypes.SqlInt64 (1)
> > Dim ds as dataset
> >
> > param = New iAnywhere.Data.AsaClient.AsaParameter("@address_id",
> > iAnywhere.Data.AsaClient.AsaDbType.BigInt)
> > param.Value = intAddressId
> >
> > ds = SqlHelper.ExecuteDataset(_AsaTransaction,
> CommandType.StoredProcedure,
> > "p_address_s", param)
> > '****************************************
> >
> > Once I execute this I get the following message: "Specified cast is not
> > valid"
> >
> > Here is the stack trace:
> > " at System.Convert.ToInt64(Object value)
> > at iAnywhere.Data.AsaClient.AsaDataConvert.DotNetToAsa(Object valIn,
> > AsaDbType asaDbType, Int32 size, Int32 offset)
> > at
> > iAnywhere.Data.AsaClient.AsaParameterCollection.GetParameterInfo(Int32&
> > count, AsaParameterDM** ppParmsDM)
> > at iAnywhere.Data.AsaClient.AsaCommand.BindParameters()
> > at iAnywhere.Data.AsaClient.AsaCommand.PreExecute()
> > at iAnywhere.Data.AsaClient.AsaCommand._ExecuteReader(CommandBehavior
> > commandBehavior)
> > at iAnywhere.Data.AsaClient.AsaCommand.ExecuteReader()
> > at iAnywhere.Data.AsaClient.AsaDataAdapter.OpenDataReader(Boolean
> > schemaOnly, Boolean& closeConnection)
> > at iAnywhere.Data.AsaClient.AsaDataAdapter.Fill(DataSet dataSet,
Int32
> > startRecord, Int32 maxRecords, String srcTable)
> > at iAnywhere.Data.AsaClient.AsaDataAdapter.Fill(DataSet dataSet)
> > at Senco.DatabaseAccess.Asa.SqlHelper.ExecuteDataset(AsaTransaction
> > transaction, CommandType commandType, String commandText, AsaParameter[]
> > commandParameters) in
> > C:\Proj\Dev\Common\DataAccess_iAnywhere\SqlHelper.vb:line 544
> > at Senco.DIS.DataAccessLayer.Address.Delete(Transaction trxSenco,
> > addressRow tdsAddress) in
> > C:\Proj\Dev\Senco.DIS.DataAccessLayer\Address.vb:line 96
> > at Senco.DIS.BusinessLogicLayer.Address.Save(Transaction trxSenco,
> > xsdAddress tdsAddress) in
> > C:\Proj\Dev\Senco.DIS.BusinessLogicLayer\Address.vb:line 55"
> >
> > Here is my environment:
> > Windows XP Service Pack 1
> > SqlAnywhere Version 8.0.2.4251
> > Visual Studio 2003 (.Net Framework 1.1)
> >
> >
>
>