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.

SYBASE ASA and ADO.NET question

2 posts in General Discussion Last posting was on 2003-08-22 21:54:16.0Z
VBM Posted on 2003-08-22 18:12:10.0Z
From: "VBM" <legendnews@lycos.co.uk>
Newsgroups: ianywhere.public.general
Subject: SYBASE ASA and ADO.NET question
Lines: 25
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
NNTP-Posting-Host: 12.25.165.67
X-Original-NNTP-Posting-Host: 12.25.165.67
Message-ID: <3f465cfa$1@forums-1-dub>
Date: 22 Aug 2003 11:12:10 -0700
X-Trace: forums-1-dub 1061575930 12.25.165.67 (22 Aug 2003 11:12:10 -0700)
X-Original-Trace: 22 Aug 2003 11:12:10 -0700, 12.25.165.67
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:1659
Article PK: 3882

I am using ADO.NET and Sybase ASA. I am using IODBCconnection. Opening the
sybase connection from DSN. I am trying to access the store proc with a
single parameter. When the following syntax is used I get errors in Sybase
but it works good for SQL Server. (some code is shown here, parameter
addition is not shown here)

myCommand.CommandType = CommandType.StoredProcedure;
myCommand.CommandText = "GetAppVariables";


But when I changed the code to the following it works.

myCommand.CommandType = CommandType.StoredProcedure;
myCommand.CommandText = "{call GetAppVariables(?)}";

This is really making my code not universal for different databases...Sybase
needs "{call <procedureName>(?)}" kind of syntax

How can I keep the same code and work for both databases.

Thanks

Vinod


Chris Keating (iAnywhere Solutions) Posted on 2003-08-22 21:54:16.0Z
From: "Chris Keating \(iAnywhere Solutions\)" <FightSpam_keating@iAnywhere.com>
Newsgroups: ianywhere.public.general
References: <3f465cfa$1@forums-1-dub>
Subject: Re: SYBASE ASA and ADO.NET question
Lines: 59
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
NNTP-Posting-Host: keating-xp.sybase.com
X-Original-NNTP-Posting-Host: keating-xp.sybase.com
Message-ID: <3f469108$1@forums-1-dub>
Date: 22 Aug 2003 14:54:16 -0700
X-Trace: forums-1-dub 1061589256 172.31.140.66 (22 Aug 2003 14:54:16 -0700)
X-Original-Trace: 22 Aug 2003 14:54:16 -0700, keating-xp.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:1660
Article PK: 3884

Please refrain from crossposting....

--

Chris Keating
Sybase Adaptive Server Anywhere Professional Version 8

****************************************************************************
*
Sign up today for your copy of the SQL Anywhere Studio 9 Developer Edition
and try out the market-leading database for mobile, embedded and small to
medium sized business environments for free!

http://www.ianywhere.com/promos/deved/index.html

****************************************************************************
*

iAnywhere Solutions http://www.iAnywhere.com

** Please only post to the newsgroup

** Whitepapers can be found at http://www.iAnywhere.com/developer
** EBFs can be found at http://downloads.sybase.com/swx/sdmain.stm
** Use CaseXpress to report bugs http://casexpress.sybase.com

****************************************************************************
*

"VBM" <legendnews@lycos.co.uk> wrote in message
news:3f465cfa$1@forums-1-dub...
> I am using ADO.NET and Sybase ASA. I am using IODBCconnection. Opening the
> sybase connection from DSN. I am trying to access the store proc with a
> single parameter. When the following syntax is used I get errors in Sybase
> but it works good for SQL Server. (some code is shown here, parameter
> addition is not shown here)
>
> myCommand.CommandType = CommandType.StoredProcedure;
> myCommand.CommandText = "GetAppVariables";
>
>
> But when I changed the code to the following it works.
>
> myCommand.CommandType = CommandType.StoredProcedure;
> myCommand.CommandText = "{call GetAppVariables(?)}";
>
> This is really making my code not universal for different
databases...Sybase
> needs "{call <procedureName>(?)}" kind of syntax
>
> How can I keep the same code and work for both databases.
>
> Thanks
>
> Vinod
>
>