0

What kind of connection strings are these?

DRIVER={Microsoft ODBC for Oracle};SERVER=*****;UID=*****;PWD=*****;
Driver={SQL Server};Server=*****;UID=*****;PWD=*****;Database=*****;

I'm working on migrating an application from classic ASP to .NET. In the old app, connection strings like the ones above were used with the ADODB.Connection object:

set AppDBcn = server.CreateObject("ADODB.Connection")
set AppRS = server.CreateObject("ADODB.Recordset")

I've tried using .NET's ADODB.Connection class and the OdbcConnection class to open these, but keep getting connection errors like "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified" or "[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied."

Am I using the wrong .NET connection classes for these types of connection strings, or is there something more sinister going on here?

Thanks!

2 Answers 2

1

Reference there. Connection String for .NET

Connection String for .NET

Sign up to request clarification or add additional context in comments.

Comments

0
var conn = new System.Data.SqlClient.SqlConnection(
             "Data Source=myServerAddress;
              Initial Catalog=myDataBase;
              User Id=myUsername;
              Password=myPassword;");

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.