Connecting to Sybase using ADO.NET in VB.NET

Onkar
Onkar used Ask the Experts™
on
Hi Experts,

I Started working on VB.NET recently. Can anyone will help me in getting the connection to Sybase & ORACLE database with ADO.NET. Also which are the drivers I need to have to connect to the Sybase & ORACLE database.

Waiting for the Answer.

Thanks in Advance
Onkar
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Hi Onkar,

As far as i know there are 3 ways to connect to a data base in .net

1. Use a ado.net data provider - these allow you to connect directly to the database and are very fast and effiecent.  Unfortuantly only a couple of ado.net data providers exist.  SQL Server (microsofts data base) and Oracle.  To use these providers you would need to use (c# terminology, im not sure what it is for vb) System.Data.SqlClient or System.Data.Oracle for the respective drivers.  The use the classes that come in this namespace like OracleConnection, OracleCommand, OracleDataAdapter etc etc

2. Connect using OLE DB.  You would need to include the System.Data.OleDb namespace and then connect to your database with drviers provided by your database manufacturer.  These are more common then .net data providers but still not 100 percent supported.  I believe Sybase offers drivers for system 12 and later.

3. Connect using ODBC.  for the legacy databases, Sybase 11 or lower, etc etc.  you can connect with good old ODBC drivers.  Before you do this you need to download the .net extention for ODBC becuase its not included in the release product.  Once you install that you can add a reference to your project to that dll, and then connect with ODBC drivers.  Most of these drivers are provided on the CDs that came with the database.

so if i were you id try to use the ado.net oracle data provider for the oracle and ole db / odbc for sybase depending on which versionof sybase u have.

hth
Leprosy

Commented:
For Oracle connections, the easiest way is to download the Microsoft .Net Managed Driver,

http://www.microsoft.com/downloads/details.aspx?FamilyID=4f55d429-17dc-45ea-bfb3-076d1c052524&DisplayLang=en

Set the reference in the project and use as a usual System.Data.OracleClient object.

For Sybase, Download the latest patch (EBF) and set a reference like this:

using iAnywhere.Data.AsaClient;

HTH.



Ivar.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial