ORA-06413: Connection not open. from ASP.NET and Oracle 10g - asp.net

I am trying to connect oracle 10g 32 bit from a c# asp.net web application using oledbconnection and getting the following error :
ORA-06413: Connection not open.
It's connecting properly from windows application and TOAD/SQL* PLUS.
I googled the problem and tried all the possible solution (checking special character) but none of them helped.
Please help.

The problem could be that your .exe filename has more than one ".", or if your file path has parenthesis "()":
https://forums.oracle.com/forums/thread.jspa?messageID=10129961

After creating a connection object. You have to open the connection to execute the SQL commands.
Lets say you created a connection object of oracle with name oracleConnection.
Then after that you have to use
oracleConnection.Open();
to open the connection to the oracle database you are trying to connect.
The other problem may be with your oracle service which might not be running. so check that the oracle service is running in the background.

I did it atlast. I uninstalled VS2010 from my machine. Format it. Again i install VS2010 in a new folder in c: called VS2010. Now its going fine. Thanks anyway all of you for your response.

Related

CyrstalReport connection to Oracle DB on ASP.NET site do not work

I setup a small asp.net site with CrytsalReportViewer web component (V13). The display of reports works well and now I would like to refresh the data in the report.
The report was created with Oracle ODBC connection and works on my PC. When I try to refresh data on the asp.net web site, which runs on WinXP (32Bit), CR shows me always a dialog to enter/verify db values like server name, user and password.
The DB values are correct and the Oracle ODBC Client (10.2.0.1) 32Bit is installed and configured. I can tnsping my database and the ODBC connections works well too. It looks like CrystalReports cannot find the ODBC which is specified in the report although the ODBC connection with this name exists.
Any idea what I can check to make it work?
Is there any logfile of CrystalReportViewer component to see why CR cannot connect?
Thanks in advance,
AlexS
I Got it. After installing another Oracle client (11g R2) it works perfectly. It seems that old Oracle client 10.2.0.1 is not full comapatible with the current CrystalReportViewer version.

How to connect to an Informix Database from an ASP.NET script?

I've never coded in ASP.NET, but I've been a web (PHP) developer for almost 3years now,
Problem is I've never coded in anything .NET after I completed my studies and I've never worked with IIS and MS Servers either.
I need to create a connection from an ASP.NET (VB) script to an Informix database.
google took me to this; IBM Informix connection example but I haven't a clue how to add these drivers to IIS, the IBM Informix Client SDK is installed on the server, but when I open the dialogs in IIS to add them as Handlers, I'm prompted for things I don't know the meaning of, I haven't found anything that says tutorial that is of any help and nor have I found anything on stack overflow.
I feel like an African stuck in China, what the hell do I do first and where do I go?
I have used ODBC in the past to connect to Informix, like this. If you have an Informix DBA, he will provide the values for host, server, and service. host is the name of the host machine where the database server resides. service is the service name in the services file but it actually maps to the port Informix listens. Server is the actual server.
string connectionString = "Driver={INFORMIX};host=myhost;server=myserver;service=23300;protocol=onsoctcp;database=dbase;uid=user;pwd=pass;client_locale=en_US.CP1252;db_locale=en_US.8859-1;"
OdbcConnection conn = new OdbcConnection(connectionString);
conn.Open();
For more connection string samples, see here.
To test, you can create an ODBC data source and test the connection without writing any code.
Okay, so as it turns out, I didn't find anything solid, so I went to find help in a clients office from an experienced .NET developer.
I was told to create a DSN on the server machine using ODBC, in the steps explained here
after that I referred to the DSN connection in the connection string, like this;
DSN=myDsn;Uid=myUsername;Pwd=p%W$d;
And I had to add impersonation to my asp.net scripts, as is done here using the same user I was logged in as when creating the DSN connections in ODBC
I had similar issues when trying to connect to an Informix DB from ASP.NET Console Application, but eventually found a way to connect! Here is the connection string i used that did the trick:
Database=db_cra;Host=192.168.160.207;Server=sipccx1_uccx;Service=1504;Protocol=onsoctcp;UID=MyUserId;Password=MyPassWord;DB_LOCALE=EN_US.UTF8;CLIENT_LOCALE=EN_US.UTF8;
Notes: The DB_LOCALE and CLIENT_LOCALE were the missing puzzle pieces for me. Also, "Service" means "Port" and "Server" is Informix instance name - defined in the database configuration (see: Finding Informix DB Server )
I downloaded and installed the Informix Client SDK provided by IBM and found that it comes with sample code (for both C# and VB). The path to the samples are C:\Program Files\IBM Informix Client SDK\demo\dotnetdemo\quickstart\cs
Add your connection string to the conninfo.xml file and run the file named helloworldconnect.cs as a console app to test connection. Your results will spit out into a file named "log.txt" (found in the bin/Debug folder).
BTW - I downloaded the 64 bit version of the "IBM Informix Client SDK". Trying to run it gave me "BadImageFormatException" so i had to switch my Platform Target to x64.
The SDK readme docs say it is IBM Informix .NET Provider Version 4.10.FC5 released on March 26, 2015. This link should give you a list of Windows 64 bit drivers (you will need to create an IBM account to download). On this page you can change the filter settings (top of page) to get other operating systems.
Whew.. now onto pulling data!
One more thing.. this book "IBM Informix Developer's Handbook" (https://play.google.com/books/reader?id=eprEAgAAQBAJ ) is a great resource and its free!

Sql Server Error 26 Local

(The database is on my PC)
My database worked just fine for a month, and then this error came. It is not related to a specific file, nor a specific project (Even if I'll create a new website and try to add a new database file, this error will pop)
I guess it happens because the sql server is not running on my PC, and it is true that I don't see any sql related process running.
How the I fix it?
P.S. I know this error has a lot of threads on the internet and even here in SO. But most of them solve the problem for a complicated, secured connection with a remote server. All I want is to create a new empty ASP.NET website and add a new .mdf file for it on my PC.
It may be related with the SQL Service authentication which you have to verify from the control panel->Administrative tools->Services. Locate SQL Server(Express) Try changing the Log on As Network Service instead of local system.
that is a error Locating Server or Instance.
Try connecting by IP.
Have you disabled SQL Server browser?
I was facing something similar so I will share how I solved it, it might work for you or not, but here are my 2 cents.
My environment: Windows 10 ( upgraded from windows 8 in which SQL Server was working fine)
SQL Server 2014 Express
Solution: I Opened the services program, and found the SQL Server services, I saw that all of of them were up except by one which was disabled, the "SQL Server Agent", I enabled it and was able to connect to my DB instance.
Hope it helps
Regards

Connecting to Oracle database

Today is my first day trying to use Oracle databases in Asp.NET so I have no idea of what I need to do.
I have added this code
Dim oOracleConn As OracleConnection = New OracleConnection()
oOracleConn.ConnectionString = "Data Source=xxxxx;User Id=yyy;Password=psw;"
oOracleConn.Open()
Response.write("Connected to Oracle.")
oOracleConn.Close()
oOracleConn.Dispose()
End Sub
But it gives me the error
Type 'OracleConnection' is not defined.
Now i've had a look on the internet and it says that it may be the reference to the DLL that is missing?
I know I have got a DLL reference in my page and I don't think I even have the DLL anywhere on my server.
Where do I get this DLL from?
I've downloaded the ODBC .NET data provider but this didn't seem to help.
I've tried to add a reference in Visual Studio but I can't find the Oracle client reference in the list.
Any ideas?
Thanks
The Oracle recommended method is to use the Oracle Data Provider for .NET
You'll need an Oracle Client that is compatible with the version of the database you are using installed on your dev machine and the web sever machine.
There are some quirks with how you have to specify the database connection string. Some kind internet soul has documented the database connection strings for the oracle providers.
The oracle client has a file, called TNSNAMES.ORA, which is typically located in the /NETWORK/ADMIN folder under the oracle home where the client was installed (the installation location varies by version and installation settings).
This file contains a list of databases with the Port Number, Hostname, and Oracle SID which allows the oracle client to make a connection to a server.
Once all of this is configured (or you decide to use the "TNS-less" connection string), you should be able to make database connections to oracle.
The ODP.NET provider documentation also provides some sample code which is very helpful when getting started with it.
Per this, this OracleConnection is an obsolete API, however the DLL being used is:
System.Data.OracleClient.dll
EDIT: This article provides some data on different API's to connect to Oracle with .NET
The real problem is data type mapping,but not connection or provider .

Problem connecting to Oracle database via ASP.NET page under IIS

I'm having a problem getting a simple ASP.NET webpage to display. The page contains a GridView with a SqlDataSource connected to an Oracle database.
When I run the page in the VS debugger (cassini webserver) everything works fine, but when I publish the application to my local IIS server (same machine), I get the following error:
ORA-12154: TNS:could not resolve the connect identifier specified
If it was a different machine I could understand that it might be a tnsnames.ora or other problem that I could investigate via tnsping. I have also set the security on the folder containing the Oracle drivers to "Everybody", and set the webapp to run under a "Priviliged" AppPool (Identity as Administrator), but with no success.
Anyone else got any ideas??
this guide is a bible for this kinds of problems :)
Actually i have printed one copy of this guide and distribute it to every consultant involved with IIS ASP.NET to ORACLE connectivity issues. The checklist will probably get your problem solved, unless you have a problem within your code which you don't seem to have based on your scenario.
I think you more than 1 Oracle client. You need to search ALL your tnsnames.ora files with the windows explorer and compare and synchronize ALL those files.
maybe you need to specify the IP

Resources