Solved

Connecting from ASP.NET to Sybase 12.x

Posted on 2004-08-03
3
622 Views
Last Modified: 2011-09-20
Hi,

I am at early stages of creating a Web application using ASP.NET and Visual Studio .NET.  I would like to know what is the proper code for connecting to Sybase using OleDbConnection?  I set up a DSN using Dsedit and called it 'mars'.

I am very new to this.  I always used ODBC before, and have no experience with ASP. NET (just took a course).

Thank you,

Mirek
0
Comment
Question by:drozdzowski
  • 2
3 Comments
 
LVL 29

Accepted Solution

by:
leonstryker earned 500 total points
ID: 11718765
Take a look here:

http://www.able-consulting.com/dotnet/adonet/Data_Providers.htm#AdaptiveServerEnterpriseNETDataProvider

Using C#

using Sybase.Data.AseClient;
...
AseConnection oAseConn = new AseConnection();
oAseConn.ConnectionString = "Data Source=(local);" +
                            "Initial Catalog=myDatabaseName;" +
                            "User ID=myUsername;" +
                            "Password=myPassword"
oAseConn.Open();


Using VB.NET
Imports System.Data.AseClient
...
Dim oAseConn As AseConnection = New AseConnection()
oAseConn.ConnectionString = "Data Source=(local);" & _
                            "Initial Catalog=myDatabaseName;" & _
                            "User ID=myUsername;" & _
                            "Password=myPassword"

Leon
0
 

Author Comment

by:drozdzowski
ID: 11718961
Thank you.  It's definitely pointing me in the right direction.  I can see that I need to use ASE ADO.NET Data Provider, rather than OLE DB provider.  I'll look more into this.

Mirek
0
 
LVL 29

Expert Comment

by:leonstryker
ID: 11718976
No problem.  Thanks for the grade,

Leon
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question