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.

Connection string in C#

4 posts in General Discussion Last posting was on 2004-04-08 01:39:55.0Z
Chandresh Patel Posted on 2004-04-07 00:53:50.0Z
From: "Chandresh Patel" <bapashree@yahoo.com>
Newsgroups: ianywhere.public.general
Subject: Connection string in C#
Lines: 25
Organization: Shreeji Smart Solution
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: ac841d19.ipt.aol.com
X-Original-NNTP-Posting-Host: ac841d19.ipt.aol.com
Message-ID: <4073430e@forums-1-dub>
Date: 6 Apr 2004 16:53:50 -0800
X-Trace: forums-1-dub 1081295630 172.132.29.25 (6 Apr 2004 16:53:50 -0800)
X-Original-Trace: 6 Apr 2004 16:53:50 -0800, ac841d19.ipt.aol.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2928
Article PK: 6397

Hi,

I am using Sybase Anywhere 9.0.1.1108

My database is on Internet Server
=======================

When I am using ODBC that time my connection string is :

m_Cnn = new AsaConnection("Data
Source=SAnalyz;UID=dba;PWD=swamibapa;pooling=false");


Now I want to chang this ODBC connection to OLEDB so what should i have to
write

m_Cnn = new AsaConnection("uid=dba;pwd=swamibapa;eng=Rohit08031DD");

This is giving me error....Server is not found (How do i pass this thing
with port number)


Thanks in Advance.


Chris Keating (iAnywhere Solutions) Posted on 2004-04-07 02:23:16.0Z
From: "Chris Keating \(iAnywhere Solutions\)" <FightSpam_keating@iAnywhere.com>
Newsgroups: ianywhere.public.general
References: <4073430e@forums-1-dub>
Subject: Re: Connection string in C#
Lines: 83
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
X-Original-NNTP-Posting-Host: cpe0080c6f83676-cm012059936305.cpe.net.cable.rogers.com
Message-ID: <40735800@forums-2-dub>
X-Original-Trace: 6 Apr 2004 18:23:12 -0800, cpe0080c6f83676-cm012059936305.cpe.net.cable.rogers.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 6 Apr 2004 18:23:13 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 6 Apr 2004 18:23:16 -0800
X-Trace: forums-1-dub 1081300996 10.22.108.75 (6 Apr 2004 18:23:16 -0800)
X-Original-Trace: 6 Apr 2004 18:23:16 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2929
Article PK: 6395

If you what to use ODBC or ADO connectivity, you will not be using the
Adaptive Server Anywhere .NET Data Provider (of which AsaConnection is a
class).

To connect in C# using ODBC, you must download the ODBC .Net data provider
from
http://www.microsoft.com/downloads/details.aspx?FamilyId=6CCD8427-1017-4F33-A062-D165078E32B1&displaylang=en

In the sample code provided, the connection is being made using the managed
provider. It uses the data source only as a source of the connection
parameter information. The DSN is overhead and its information could have
been defined directly within your connection string. ODBC plays no role in
the connection.

As for connectivity using OLEDB, see the MSDN site for examples of how to
use OLEDB in the .NET development environment. The ASA provider is
ASAProv.90 (but you could use the ODBC-OLEDB bridge msdasql as a provider).
The connectivity string rules remain for this connectivity method. The
following link may help:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdataoledboledbconnectionclasstopic.asp

I would recommend that you use the ASA Managed Provider and not revert to
ODBC or OLEDB. This is currently the connectivity method that you are using.



--

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

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

"Chandresh Patel" <bapashree@yahoo.com> wrote in message
news:4073430e@forums-1-dub...
> Hi,
>
> I am using Sybase Anywhere 9.0.1.1108
>
> My database is on Internet Server
> =======================
>
> When I am using ODBC that time my connection string is :
>
> m_Cnn = new AsaConnection("Data
> Source=SAnalyz;UID=dba;PWD=swamibapa;pooling=false");
>
>
> Now I want to chang this ODBC connection to OLEDB so what should i have to
> write
>
> m_Cnn = new AsaConnection("uid=dba;pwd=swamibapa;eng=Rohit08031DD");
>
> This is giving me error....Server is not found (How do i pass this thing
> with port number)
>
>
> Thanks in Advance.
>
>


Chris Keating (iAnywhere Solutions) Posted on 2004-04-07 03:19:37.0Z
From: "Chris Keating \(iAnywhere Solutions\)" <FightSpam_keating@iAnywhere.com>
Newsgroups: ianywhere.public.general
References: <4073430e@forums-1-dub> <40735800@forums-2-dub>
Subject: Re: Connection string in C#
Lines: 197
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
X-Original-NNTP-Posting-Host: cpe0080c6f83676-cm012059936305.cpe.net.cable.rogers.com
Message-ID: <40736534@forums-2-dub>
X-Original-Trace: 6 Apr 2004 19:19:32 -0800, cpe0080c6f83676-cm012059936305.cpe.net.cable.rogers.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 6 Apr 2004 19:19:34 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 6 Apr 2004 19:19:37 -0800
X-Trace: forums-1-dub 1081304377 10.22.108.75 (6 Apr 2004 19:19:37 -0800)
X-Original-Trace: 6 Apr 2004 19:19:37 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2930
Article PK: 6398

Here is an example based on a .Net console application that shows
connectivity examples for ODBC .Net, OLEDB.Net and Adaptive Server Anywhere
.NET data providers. Make note of the fact that neither the OLEDB or ASA
.NET examples make use of the DSN.

// connect using ODBC
try
{
Console.WriteLine( "Attempting to connect using ODBC" );
OdbcConnection odbcConn = new OdbcConnection( "DSN=ASA 9.0 Sample" );
odbcConn.Open();
Console.WriteLine( "Connectivity via ODBC succeeded!" );
odbcConn.Close();

}
catch ( Exception ex )
{
Console.WriteLine( "Connectivity via ODBC failed!" );
Console.WriteLine( ex.Message );
}

Console.WriteLine( );

// connect using OLEDB
try
{
Console.WriteLine( "Attempting to connect using ODBC" );
OleDbConnection oledbConn = new OleDbConnection();
oledbConn.ConnectionString =
"Provider=ASAProv.90;Eng=ASADEMO9;Start=C:\\Program Files\\Sybase\\SQL
Anywhere 9\\win32\\dbeng9.exe -c 8m;DBF=C:\\Program Files\\Sybase\\SQL
Anywhere
9\\asademo.db;AutoStart=Yes;AutoStop=Yes;Links=ShMem;Uid=dba;Pwd=sql";
oledbConn.Open( );
Console.WriteLine( "Connectivity via OLEDB succeeded!" );
oledbConn.Close( );

}
catch ( Exception ex )
{
Console.WriteLine( "Connectivity via OLEDB failed!" );
Console.WriteLine( ex.Message ); }
}


Console.WriteLine( );

// connect using Adaptive Server Anywhere .NET Data Provider

try
{
Console.WriteLine( "Attempting to connect using Adaptive Server Anywhere
.NET Data Provider" );
AsaConnection AsaConn = new AsaConnection();
AsaConn.ConnectionString = "Eng=ASADEMO9;Start=C:\\Program
Files\\Sybase\\SQL Anywhere 9\\win32\\dbeng9.exe -c 8m;DBF=C:\\Program
Files\\Sybase\\SQL Anywhere
9\\asademo.db;AutoStart=Yes;AutoStop=Yes;Links=ShMem;Uid=dba;Pwd=sql";
AsaConn.Open( );
Console.WriteLine( "Connectivity via Adaptive Server Anywhere .NET Data
Provider succeeded!" );
AsaConn.Close( );


}
catch ( Exception ex )
{
Console.WriteLine( "Connectivity via Adaptive Server Anywhere .NET Data
Provider failed!" );
Console.WriteLine( ex.Message );
}


--

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

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

"Chris Keating (iAnywhere Solutions)" <FightSpam_keating@iAnywhere.com>

wrote in message news:40735800@forums-2-dub...
> If you what to use ODBC or ADO connectivity, you will not be using the
> Adaptive Server Anywhere .NET Data Provider (of which AsaConnection is a
> class).
>
> To connect in C# using ODBC, you must download the ODBC .Net data provider
> from
>
http://www.microsoft.com/downloads/details.aspx?FamilyId=6CCD8427-1017-4F33-A062-D165078E32B1&displaylang=en
>
> In the sample code provided, the connection is being made using the
managed
> provider. It uses the data source only as a source of the connection
> parameter information. The DSN is overhead and its information could have
> been defined directly within your connection string. ODBC plays no role in
> the connection.
>
> As for connectivity using OLEDB, see the MSDN site for examples of how to
> use OLEDB in the .NET development environment. The ASA provider is
> ASAProv.90 (but you could use the ODBC-OLEDB bridge msdasql as a
provider).
> The connectivity string rules remain for this connectivity method. The
> following link may help:
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdataoledboledbconnectionclasstopic.asp
>
> I would recommend that you use the ASA Managed Provider and not revert to
> ODBC or OLEDB. This is currently the connectivity method that you are
using.
>
>
>
> --
>
> 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
>
>
****************************************************************************
> *
>
> "Chandresh Patel" <bapashree@yahoo.com> wrote in message
> news:4073430e@forums-1-dub...
> > Hi,
> >
> > I am using Sybase Anywhere 9.0.1.1108
> >
> > My database is on Internet Server
> > =======================
> >
> > When I am using ODBC that time my connection string is :
> >
> > m_Cnn = new AsaConnection("Data
> > Source=SAnalyz;UID=dba;PWD=swamibapa;pooling=false");
> >
> >
> > Now I want to chang this ODBC connection to OLEDB so what should i have
to
> > write
> >
> > m_Cnn = new AsaConnection("uid=dba;pwd=swamibapa;eng=Rohit08031DD");
> >
> > This is giving me error....Server is not found (How do i pass this thing
> > with port number)
> >
> >
> > Thanks in Advance.
> >
> >
>
>


Chandresh Patel Posted on 2004-04-08 01:39:55.0Z
From: "Chandresh Patel" <bapashree@yahoo.com>
Newsgroups: ianywhere.public.general
References: <4073430e@forums-1-dub> <40735800@forums-2-dub> <40736534@forums-2-dub>
Subject: Re: Connection string in C#
Lines: 222
Organization: Shreeji Smart Solution
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: ac9b2c91.ipt.aol.com
X-Original-NNTP-Posting-Host: ac9b2c91.ipt.aol.com
Message-ID: <40749f5b@forums-1-dub>
Date: 7 Apr 2004 17:39:55 -0800
X-Trace: forums-1-dub 1081384795 172.155.44.145 (7 Apr 2004 17:39:55 -0800)
X-Original-Trace: 7 Apr 2004 17:39:55 -0800, ac9b2c91.ipt.aol.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2940
Article PK: 6408

Thank you very much.


"Chris Keating (iAnywhere Solutions)" <FightSpam_keating@iAnywhere.com>

wrote in message news:40736534@forums-2-dub...
> Here is an example based on a .Net console application that shows
> connectivity examples for ODBC .Net, OLEDB.Net and Adaptive Server
Anywhere
> .NET data providers. Make note of the fact that neither the OLEDB or ASA
> .NET examples make use of the DSN.
>
> // connect using ODBC
> try
> {
> Console.WriteLine( "Attempting to connect using ODBC" );
> OdbcConnection odbcConn = new OdbcConnection( "DSN=ASA 9.0 Sample" );
> odbcConn.Open();
> Console.WriteLine( "Connectivity via ODBC succeeded!" );
> odbcConn.Close();
>
> }
> catch ( Exception ex )
> {
> Console.WriteLine( "Connectivity via ODBC failed!" );
> Console.WriteLine( ex.Message );
> }
>
> Console.WriteLine( );
>
> // connect using OLEDB
> try
> {
> Console.WriteLine( "Attempting to connect using ODBC" );
> OleDbConnection oledbConn = new OleDbConnection();
> oledbConn.ConnectionString =
> "Provider=ASAProv.90;Eng=ASADEMO9;Start=C:\\Program Files\\Sybase\\SQL
> Anywhere 9\\win32\\dbeng9.exe -c 8m;DBF=C:\\Program Files\\Sybase\\SQL
> Anywhere
> 9\\asademo.db;AutoStart=Yes;AutoStop=Yes;Links=ShMem;Uid=dba;Pwd=sql";
> oledbConn.Open( );
> Console.WriteLine( "Connectivity via OLEDB succeeded!" );
> oledbConn.Close( );
>
> }
> catch ( Exception ex )
> {
> Console.WriteLine( "Connectivity via OLEDB failed!" );
> Console.WriteLine( ex.Message ); }
> }
>
>
> Console.WriteLine( );
>
> // connect using Adaptive Server Anywhere .NET Data Provider
>
> try
> {
> Console.WriteLine( "Attempting to connect using Adaptive Server Anywhere
> .NET Data Provider" );
> AsaConnection AsaConn = new AsaConnection();
> AsaConn.ConnectionString = "Eng=ASADEMO9;Start=C:\\Program
> Files\\Sybase\\SQL Anywhere 9\\win32\\dbeng9.exe -c 8m;DBF=C:\\Program
> Files\\Sybase\\SQL Anywhere
> 9\\asademo.db;AutoStart=Yes;AutoStop=Yes;Links=ShMem;Uid=dba;Pwd=sql";
> AsaConn.Open( );
> Console.WriteLine( "Connectivity via Adaptive Server Anywhere .NET Data
> Provider succeeded!" );
> AsaConn.Close( );
>
>
> }
> catch ( Exception ex )
> {
> Console.WriteLine( "Connectivity via Adaptive Server Anywhere .NET Data
> Provider failed!" );
> Console.WriteLine( ex.Message );
> }
>
>
> --
>
> 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
>
>
****************************************************************************
> *
>
> "Chris Keating (iAnywhere Solutions)" <FightSpam_keating@iAnywhere.com>
> wrote in message news:40735800@forums-2-dub...
> > If you what to use ODBC or ADO connectivity, you will not be using the
> > Adaptive Server Anywhere .NET Data Provider (of which AsaConnection is a
> > class).
> >
> > To connect in C# using ODBC, you must download the ODBC .Net data
provider
> > from
> >
>
http://www.microsoft.com/downloads/details.aspx?FamilyId=6CCD8427-1017-4F33-A062-D165078E32B1&displaylang=en
> >
> > In the sample code provided, the connection is being made using the
> managed
> > provider. It uses the data source only as a source of the connection
> > parameter information. The DSN is overhead and its information could
have
> > been defined directly within your connection string. ODBC plays no role
in
> > the connection.
> >
> > As for connectivity using OLEDB, see the MSDN site for examples of how
to
> > use OLEDB in the .NET development environment. The ASA provider is
> > ASAProv.90 (but you could use the ODBC-OLEDB bridge msdasql as a
> provider).
> > The connectivity string rules remain for this connectivity method. The
> > following link may help:
> >
> >
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdataoledboledbconnectionclasstopic.asp
> >
> > I would recommend that you use the ASA Managed Provider and not revert
to
> > ODBC or OLEDB. This is currently the connectivity method that you are
> using.
> >
> >
> >
> > --
> >
> > 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
> >
> >
>
****************************************************************************
> > *
> >
> > "Chandresh Patel" <bapashree@yahoo.com> wrote in message
> > news:4073430e@forums-1-dub...
> > > Hi,
> > >
> > > I am using Sybase Anywhere 9.0.1.1108
> > >
> > > My database is on Internet Server
> > > =======================
> > >
> > > When I am using ODBC that time my connection string is :
> > >
> > > m_Cnn = new AsaConnection("Data
> > > Source=SAnalyz;UID=dba;PWD=swamibapa;pooling=false");
> > >
> > >
> > > Now I want to chang this ODBC connection to OLEDB so what should i
have
> to
> > > write
> > >
> > > m_Cnn = new AsaConnection("uid=dba;pwd=swamibapa;eng=Rohit08031DD");
> > >
> > > This is giving me error....Server is not found (How do i pass this
thing
> > > with port number)
> > >
> > >
> > > Thanks in Advance.
> > >
> > >
> >
> >
>
>
>