Difference connecting to remote Oracle between running in VS 2005 IDE (express) and web browser? RRS feed

  • Question

  • Hi,


    I have a question here,


    I am running web developer 2005  Express C# and have successfully connected to a remote Oracle database using Database Explorer comes with the IDE, I can run query (new query option) from IDE without any problems.


    But when I create a connection from the web form and run from the web browser by copy the connectionstring from the Database explorer,


    OracleConnection oraconn = new OracleConnection();
    oraconn.ConnectionString = "Data Source=MyOracle;User ID=MyID;Unicode=True";


    I got error

    ORA-01005: null password given; logon denied


    I add password attribute -


    oraconn.ConnectionString = "Data Source=MyOracle;User ID=MyID;Password = "MyPassword";Unicode=True";

    and I got error


    ORA-01004: default username feature not supported; logon denied


    I have tried using oledb, sql drivers, they all give me same errors.


    I expect when I run ny codes, the odbc window will pop up and ask me for password just like when run from IDE, but i think there is something about authentication (ASPNET vs my local login). Can someone give me some thoughts?










    Thursday, January 10, 2008 6:22 PM

All replies

  • I have always installed the correct Oracle client software for my Windows operating system before using Oracle for development.  I also test my connection through the connection property at the top of VS2005 so I know my permissions are valid and put my TNSNAMES.ORA file in my development folder.  Try the thread below for how to fix connection issues.




    Thursday, January 10, 2008 10:39 PM
  • Thanks for the reply.


    But I think I got all those covered.


    1. I am using Oracle 9i client connect to 8.i server.

    2. I have checked my TNSNAMES.ORA  fine - and I can successfully test query from the IDE


    looks like when I issue the .open command during runtime, authentication works differently when the query is run from IDE. The ODBC window does not pop up ask for password just simply throw an error. I remember sometme ago I read an article to bypass the odbc window by directly supplying username/password. At this point I will be happy just to see the window comes up , any other thoughts?






    Thursday, January 10, 2008 11:12 PM
  • I have read your first post again it may mean you have not run aspnet_regiis before trying to run the application outside of the IDE so go to the location below in your C drive and run aspnet_regiis.


    Thursday, January 10, 2008 11:39 PM
  • You should be specifying both the User ID and Password and the Password should not be enclosed in double quotes (as in your example).


    When running from a web app you definitely will not receive a popup requesting the password.


    Friday, January 11, 2008 1:20 PM
  • Thanks,


    But I did try User ID and Password without quotes and had the same results.

    The other thing is I have tried using WinForm C# and it works fine. So I think it has to do with the additional security check when IIS gets involved. I havn't got a chance to try Caddre's suggestion of running aspnet_regiis, but it sounds something very worth trying.



    Friday, January 11, 2008 2:56 PM