Re: Oracle connection with WebService



Mike:

Try/Catch the Open() statement and Trap OracleException.. see what the
exception tells you. Also, it looks like you're using a Sql Server
connection string instead of an Oracle connection string.

"Data Source=DbName;User Id=user;Password=password;Integrated Security=no;"

AFAIK, there's no UID or PWD for instance that will work w/ the Oracle
provider.
"MikeB" <MikeB@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:1741896E-F15E-4C2B-B4D0-ABA8E8663637@xxxxxxxxxxxxxxxx
>I wrote the following method to test connecting to an Oracle database:
>
> public static string HelloMyOracleDataWorld()
> {
> string ret = "";
> string connectString = "Integrated
> Security=false;PWD=password;UID=user;SERVER=server";
> OracleConnection connection = new OracleConnection(connectString);
> connection.Open();
> string sqlQuery = "SELECT * FROM table WHERE id = '00000'";
> OracleCommand dbCommandWrapper = new OracleCommand(sqlQuery,
> connection);
> using (IDataReader dataReader = dbCommandWrapper.ExecuteReader
> (CommandBehavior.CloseConnection))
> {
> if(dataReader.Read())
> {
> ret = dataReader["PROJ_START_DT"].ToString();
> }
> }
> return ret;
> }
>
> The method works great when used from a Windows Application, but as soon
> as
> I call this method from a WebService the method just hangs on the
> "connection.Open()" command. I don't have any of these problems when
> connecting to SQL from WebServices, just Oracle.
>
> Is I missing something? I'm admittedly new to this framework but I
> thought
> this should be straight forward, and like I mentioned, it works just fine
> from a Windows Application, why not from a WebService?
>
> Please help, I need to resolve this issue ASAP...
>
> Thanks!


.



Relevant Pages

  • Re: ASP.net and Oracle error System.Data.OleDb.OleDbException
    ... Also see http://www.connectionstrings.com/ and try other providers ... > Here is some of my connection code: ... >> And are you sure your connection string is ok. ... >>> Oracle error occurred, but error message could not be retrieved from ...
    (microsoft.public.dotnet.framework.aspnet)
  • connecting to Oracle from ASP.NET 2.0 ?
    ... I am able to access 9i and 10g Oracle DBs from other clients on my pc ... An error has occurred while establishing a connection to the server. ... When connecting to SQL Server 2005, this failure may be caused by the ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: ADO.Net Connection Pooling Problem with Oracle
    ... the CLR is releasing the connection to your database. ... the number of database sessions in Oracle seem to ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Connecting to Oracle From VB6
    ... Is this the provider that rewuires you to know how big your Return Data is ... > - Oracle connectivity. ... > string this connection string looks like: ... > If you choose ODBC you connection string should look like ...
    (microsoft.public.data.oledb)
  • Re: Oracle 8.1.7 client and Visual Studio 2005 connection problem ORA-12537
    ... This path is too long for the Oracle client. ... client uses the applicaton path as part of the connection string and the ... connection string was too long. ... ORA-12537 from client side applications. ...
    (microsoft.public.dotnet.framework.adonet)