469,085 Members | 1,020 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,085 developers. It's quick & easy.

Sybase connection form Visual.net C#

I'm trying to access a Sybase database using Visual .net C#
using the code below.
I've added the Sybase data provider to the references (DDTek.Sybase)
and added them to the program usage. Howver it fails to connect and
gives an Unhandled exception of type "DDTek.Sybase.SybaseException' occured in
ddtek.sybase.dll
I can connect using the sybase SQL advantage with no problems.

Cheers

CHRIS

SybaseConnection Conn=new SybaseConnection("host=localhost;port=****;Interfa cesFile=SQLBOX7.ini;Server Name=SQLBOX7;DataBase Name=varis71");

Conn.Open();
try
{
Conn.Open();
Console.WriteLine("Connection Successful");
}
catch(SybaseException ex)
{
Console.WriteLine(ex.Message);
return;
}
Conn.Close();
--------------------------------
From: Chris Fox

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>1Uhtsa2u6ESNQDOyrMfZ+Q==</Id>
Nov 17 '05 #1
4 9484
Chris,

Are there any other details to the exception? There isn't much to go on
there. Is it calling a piece of native code, and perhaps returning an error
code of some sort in the exception which you can look up?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Chris Fox via .NET 247" <an*******@dotnet247.com> wrote in message
news:uD**************@TK2MSFTNGP09.phx.gbl...
I'm trying to access a Sybase database using Visual .net C#
using the code below.
I've added the Sybase data provider to the references (DDTek.Sybase)
and added them to the program usage. Howver it fails to connect and
gives an Unhandled exception of type "DDTek.Sybase.SybaseException'
occured in
ddtek.sybase.dll
I can connect using the sybase SQL advantage with no problems.

Cheers

CHRIS

SybaseConnection Conn=new
SybaseConnection("host=localhost;port=****;Interfa cesFile=SQLBOX7.ini;Server
Name=SQLBOX7;DataBase Name=varis71");

Conn.Open();
try
{
Conn.Open();
Console.WriteLine("Connection Successful");
}
catch(SybaseException ex)
{
Console.WriteLine(ex.Message);
return;
}
Conn.Close();
--------------------------------
From: Chris Fox

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>1Uhtsa2u6ESNQDOyrMfZ+Q==</Id>

Nov 17 '05 #2
GG
If you have Sybase ASE 12.0(12.5 and up preferred) and up and only need
to run your apps in Win then you may be able to get the Sybase .net
provider from Sybase. We run our apps in Win and hit Sybase on Solaris.

This is the documentation from Sybase
http://sybooks.sybase.com/onlinebook...110e/adonet/@G
eneric__BookView

Hope it helps

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #3
Chris Fox via .NET 247 wrote:
I'm trying to access a Sybase database using Visual .net C#
using the code below.
I've added the Sybase data provider to the references (DDTek.Sybase)
and added them to the program usage. Howver it fails to connect and
gives an Unhandled exception of type "DDTek.Sybase.SybaseException'
occured in ddtek.sybase.dll
I can connect using the sybase SQL advantage with no problems.
As DataDirect's providers are somewhat expensive, I'd definitely
simply mail them and ask what's the problem. Though the exception might
contain additional information you haven't looked at in the
InnerException. Have you checked that?

Frans

Cheers

CHRIS

SybaseConnection Conn=new
SybaseConnection("host=localhost;port=****;Interfa cesFile=SQLBOX7.ini;
Server Name=SQLBOX7;DataBase Name=varis71");

Conn.Open();
try
{
Conn.Open();
Console.WriteLine("Connection Successful");
}
catch(SybaseException ex)
{
Console.WriteLine(ex.Message);
return;
}
Conn.Close();

--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Nov 17 '05 #4

I switched of the Debugger and it tells me it cannot find the SQLBOX.in
File
which is on the computer. Where dose it look for this file.
I also appear to have Sybase 11.9.2

Thanks

CHRI

--
cfoxPosted from http://www.pcreview.co.uk/ newsgroup acces

Nov 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Mike Walsh | last post: by
18 posts views Thread by David Rysdam | last post: by
3 posts views Thread by M D | last post: by
1 post views Thread by xinhuanet.com | last post: by
reply views Thread by Metal2You | last post: by
2 posts views Thread by Martin Lukasik | last post: by
26 posts views Thread by codercode | last post: by
reply views Thread by =?ISO-8859-1?Q?S=E9bastien_Sabl=E9?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.