Connection error first time, then it works after that (with same string)
pedramMay 24 2010 — edited May 30 2010I have a strange connection error problem in that I get a "OracleConnection.ConnectionString is invalid" with my ASP.NET/C# program, but when I try the page again it works after that.
I build the connection string in the code and then pass it kind of like this:
*private readonly OracleConnection conn = new OracleConnection(oradb); // class variable*
*// inside Page_Load method*
_oradb = "Password=" + oraPassword + ";User ID=" + oraUserName + ";"Data Source=mydb;"";*
_conn.Open();*
The username/login are generated elsewhere and inserted into the connection string, and when debugging I checked the connection string and it's the exact same each time. It's as if the connection gets dropped and the first time it tries to re-establish it gives the error but then it opens the connection after that and doesn't fail again in the same window.
Any ideas what this might be caused by? I close the connection in another method after getting everything I want from the DB and writing it to the screen.
The web server is IIS, the .NET version is 3.5, and the referenced Oracle library is Oracle.DataAccess.dll. Also, the DB version is 10.2.0.4. Not sure if all that's needed, but I thought I'd throw it out there just in case.
Edited by: psaleh on May 24, 2010 11:37 PM