Sybase connection form Visual.net C#

  • Thread starter Chris Fox via .NET 247
  • Start date
C

Chris Fox via .NET 247

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=****;InterfacesFile=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();
 
N

Nicholas Paldino [.NET/C# MVP]

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

Frans Bouma [C# MVP]

Chris said:
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=****;InterfacesFile=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();


--
 
Joined
Jun 3, 2005
Messages
1
Reaction score
0
Sybase Connection From Visual.net C#

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

Thanks

CHRIS
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top