0

I have a WinForms application written for .Net Framework 3.5 in VB.net using Oracle back end (Microsoft System.Data.OracleClient.dll), Target Platform "any CPU". Now my company has upgraded from Windows XP to Windows 7 -64 bit and naturally the app stopped working due to the obsolete data access namespace. I am trying to replace it with ODP.Net, however, I cannot seem to get the connectionstring right. This is what I used with the Microsoft namespace: Data Source=Oracle;server= tscpgn; Persist Security Info=false;User ID=myID;Password=mypassword How am I supposed to alter this to make it work with Oracle.DataAccess? I have tried every variation I found floating around on the web but none seems to work. For example this one definitely does not work: conn.ConnectionString ="Data Source=ServerName;User id= UserName;";"Password=mypassword;";

Since 'server' is not a valid attribute of the Oracle connectionstring I do not know how to give this piece of info to the connection object.

3
  • ODP has the OracleConnectionStringBuilder class that will build the string for you. Commented May 27, 2015 at 17:16
  • Have a look at these pages: Connection Strings and Connection Strings, they provide a bunch of ADO connection strings. Commented May 27, 2015 at 18:10
  • I also wanted to point out, Oracle now has a fully managed .Net assembly that you can install via Nuget (that doesn't require the hundreds of megs of unmanaged Oracle DLL's also). If you haven't looked at it, you should. I've been switching over my Oracle apps to it, way easier to deploy. Commented Jun 13, 2015 at 17:22

1 Answer 1

1

This is what I use with ODP.Net, replace the variables inside for your environment (it's ugly, but it's worked for me):

Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=YourOracleServer.YourCompany.org)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=YourOracleServer.YourCompany.org)));User Id=OracleUserId;Password=OraclePassword;Validate Connection=true;
Sign up to request clarification or add additional context in comments.

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.