• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1615
  • Last Modified:

DB connection timeout

This is the message I got (asp.net)

Exception Details: System.Data.OleDb.OleDbException: ORA-12535: TNS:operation timed out
It happens when trying to open the connection.
The connection is as this: Provider=MSDAORA;User ID=xxx; Password=xxx;Data Source=xxx;
cn.Open() 'error at this line

As it sounds I should increase the timeout time, so I changed the timeout to 200 as follows:
Provider=MSDAORA;User ID=xxx; Password=xxx;Data Source=xxx;connect timeout=200;
And this is the new message I got in the same line cn.open()
Exception Details: System.Data.OleDb.OleDbException: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

The app has been working fine before my office moved to a new floor in the same building. The app still
works for some of the database (use the simular method), but not some of the database. For the ones that do not work, I can still open it from server explore from within the IDE.

Can somebody help?

  • 5
  • 4
1 Solution
Try to set your Connection timeout on connection object

cn.ConnectionTimeout = 0 ' 0 for unlimited timeout
GoodJunAuthor Commented:
the cn.ConnectionTimeout is a readonly property. set the timeout to 0 (in the connection string) get the same error message as set 200 seconds.
ConnectionTimeout is not read only property. You can set it during runtime. You are setting it in Connection string. Did you try to set it on connection object instead of connection string?
BTW the same property exists for command object
Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

ConnectionTimeout is a READ ONLY property for connection object.

There is no connection time out in Command... It is command time out. there is a big difference between connection time out and command time out.
GoodJunAuthor Commented:
Can anyone explain what I should do to fix the problem. I will add more points for the comments that solve the problem. What can be wrong? it confuses me.
I don't know if it helps you.

Once I've got this error was generated when i was trying to enter null field to a database. When I modified these
fields to 0, error stopped being generated.

That is what I found somewhere

The following are two possible causes of this error:

In the registry, under the key for an OLE DB provider's CLSID, there may be an entry named OLEDB_SERVICES.
If the OLE DB provider being used to make the ADO connection doesn't have the OLEDB_SERVICES entry,
and ADO tries to set up a property that is not supported by the provider, the error occurs.

If OLEDB_SERVICES entry exists but there is a problem in the ADO connection string, the error occurs.

If the OLEDB_SERVICES registry entry is not present, the call to set up a property is made directly
to the provider. If the provider does not support the property, the SetProperties OLE DB call made by
ADO will fail. This is a fatal failure if the property is required in order to make a connection. If
the property was explicitly included in the connection string, it is most likely required.

If the property setting is optional, the failure is not fatal. This is the case when you connect without
explicitly setting the property in the connection string. In this case, ADO sets the property to True
but marks it as optional.

You can work around this problem in the following ways:

Do not use the "Persist Security Info" keyword in your ADO connection string.

Add the OLEDB_SERVICES registry entry as follows:

Start Registry Editor (Regedit.exe).

In the registry under HKEY_CLASSES_ROOT\CLSID, find the CLSID of the OLE DB Provider. For example, the
following registry key is for the Microsoft OLE DB Provider for SQL Server (SQLOLEDB):
Click the CLSID, and then on the Edit menu, click Add Value and add the following registry value:

Data Type: REG_DWORD

NOTE: To find the CLSID for the provider you are using, search for the provider's ProgID (SQLOLEDB,
for example) in the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Classes\. Under the ProgID, there will
be a key named CLSID.
GoodJunAuthor Commented:
I check the registry, the OLEDB_SERVICES key is there with the right value.

The error is when open the connection to database, not in the stage to insert value to database yet.

did you check the statement
"ADO tries to set up property that is not supported by the provider" ???

Just to be sure.
GoodJunAuthor Commented:
If MSDAORA doesn't support timeout, then is there a work around? I can view the database from server explore within the Ide. That makes me think maybe some other settings in asp.net that affects the connection. ? any suggestion?
GoodJunAuthor Commented:
I guess nobody will give more comments to this thread. Ibou, you spend most of the time. I will give the point to you. Thanks nav, I know you are the best in this site.

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now