Re: Oracle connection with WebService
- From: "MikeB" <MikeB@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 21 Jul 2005 14:39:04 -0700
Try/Catch does nothing because the "Open()" statement just hangs.
The connection string is valid, for one check out this article on the
OracleConnect.ConnectionString property...
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdataoracleclientoracleconnectionclassconnectionstringtopic.asp
and for a second thing, that couldn't be the problem because I'm able to
connect to and read from the Oracle database just fine from a Windows
application, using the identical code and connection string (as seen from my
original post) it just hangs in the WebService.....
Any other thoughts?
"W.G. Ryan MVP" wrote:
> 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!
>
>
>
.
- References:
- Oracle connection with WebService
- From: MikeB
- Re: Oracle connection with WebService
- From: W.G. Ryan MVP
- Oracle connection with WebService
- Prev by Date: multiple instances of named argument in list
- Next by Date: OracleParameters + CLOB field
- Previous by thread: Re: Oracle connection with WebService
- Next by thread: Re: Oracle connection with WebService
- Index(es):
Relevant Pages
|