Re: Oracle connection with WebService
- From: "W.G. Ryan MVP" <WilliamRyan@xxxxxxxxxxxxxxxx>
- Date: Thu, 21 Jul 2005 16:22:05 -0400
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!
.
- Follow-Ups:
- Re: Oracle connection with WebService
- From: MikeB
- Re: Oracle connection with WebService
- References:
- Oracle connection with WebService
- From: MikeB
- Oracle connection with WebService
- Prev by Date: Re: Problems implementing SQLCommand
- Next by Date: Find a row index in a dataset
- Previous by thread: RE: Oracle connection with WebService
- Next by thread: Re: Oracle connection with WebService
- Index(es):
Relevant Pages
|