OraOleDB Provider error - asp.net

I have created a website that has an oracle connection in it that works when I launch it in Visual Web Developer Express. However, when I launch the site from the server on IIS 7, I get
The 'OraOleDB.Oracle' provider is not registered on the local machine.
I am on a 64-bit machine. I have the 64-bit OLE DB Oracle driver installed and registered (using regsvr32 that everyone mentions) as well as security rights for IIS_USERS. My current connection string is below:
add name="TDRP" connectionString="Provider=OraOleDB.Oracle;Data Source=TDRP;Persist Security Info=True;Password=**;User ID=*; providerName="System.Data.OleDb"
Am I approaching this problem correctly? I saw a number of different formats for connection strings as well as using provider name "system.data.oracleclient" instead of "system.data.oledb." Also, should my data source be .NET Framework Data Provider for OLE DB or Oracle Database?
Thank you in advance!

Your driver installer may not have copied all files needed. If that is the case, you may have to manually copy the missed files. (Ref: http://codecorner.galanter.net/2011/07/27/solution-for-oraoledb-oracle-provider-is-not-registered-error/)

Related

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!

Deploy ACCESS OleDb driver

I've tried to deploy a small website (ASP.NET) which is using an MS ACCESS 2010 db. Deploying the website on the server I get the following error:
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
Connectionstring used : Provider=Microsoft.ACE.OLEDB.12.0; Data Source=path-to-db
MS Office is not installed on the server and neither is the Access Database engine. The website is runnin in a shared hosting environment, so I am not able to install office on that server, so may I somehow deploy the provider by dll's?
Is it possible to deploy the drivers needed for ASP.Net to connect to the database without having to run an installation on the server. As this is in a shared hosting environment, I am not able to install anything. Only fileupload by ftp.
Open IIS, navigate to Application Pools, find the appPool for your website, right click, advanced settings, set "Enable 32-Bit Applications" to true.
Looking around, this has nothing to do with Office. If you're only using Access as the database, then you don't need to install it. Info here: http://www.mytechsupport.ca/forums/index.php?topic=11237.0
I found this StackOverflow thread with the same error you did so it sounds like it might be the same issue. Microsoft.ACE.OLEDB.12.0 provider is not registered
If its running windows then look through that thread and see if the 64-bit issue is the problem. I've had this same issue before and its apparently quite common. You may need to e-mail whoever for support on your server.
Is it running Linux? If it is running linux then the issue might be just an entire lack of the driver to connect to Access databases. If this is the case I would e-mail your support and ask them if they can install the proper drivers for you. Info here: http://nixcraft.com/databases-servers/11878-connect-microsoft-access-database-php-linux-server.html

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 .

OleDB Provider for Oracle not found in in Windows Server 2008 with IIS 7

I'm deploying a small ASP.NET (framework 3.5) application in a Windows Server Web 2008 32 bits, IIS 7. The applications needs connection to an Oracle DB in another Server, using the tradicional DataAdapter, Oracle Connection, etc.
I´ve installed correctly the Oracle Client in the server (the server is another server´s client) and I´ve checked that this server has access to the server where the database is.
Even though my app isn´t able to connect to DataBase. The message says that Oracle components haven´t been found. It doesn´t find the OleDB Provider for Oracle or some dll.
¿Something I shluod know about permissions of the ASP.NEt users or something like this?
Some idea??
Thanks in advance.
Gus.
Check the path. It could be that the Oracle client directory is not on the path of the account that runs your ASPNET app.
Actually there are other steps you can go through, to verify the Oracle client install.
This article is old but may be helpful.

Using SQL server 2008 for ASP.net 2.0 Membership provider

I tried to set-up the SQL tables for ASP .net 2.0 membership provider by clicking on ASP.net Configuration under Project.
I have completely uninstalled SQL 2005 Express and installed SQL 2008 Express instead.
It seems like that it can not connect to the database.
Does anybody know how to get this fixed so I can use 2008 instead ?
Try to configuring the database typing "aspnet_regsql" on the VS command prompt.
Then setup the database and finally change de connection string on the web.config file.
ASP.NET SQL Server Registration Tool (Aspnet_regsql.exe)
What is your SQL 2008 installation instance called? What does your connection string for the membership provider look like?
As far as I know, there is (or was) a glitch in the SQL Server 2008 Express installation that even if you chose to install as "default" instance, it would still make it a "named instance" called ".\SQLExpress" instead. Could that be the problem?
Marc
As Marc already has pointed out, it could be the problem with the instance name. This is fixed in service pack 1 for SQL Server 2008 Express. For more information and a workaround, see this Microsoft KB article.
SQL 2005 and 2008 are both configured in a fairly locked down state by default - and this means that SQL won't accept access the database other than through Shared Memory, even with Integrated Security.
You need to enable TCP/IP or Named Pipes for the Client Protocols for the server (as this is how ASP.NET talks to SQL if you've not configured a DSN to use Shared Memory.
I can't remember the exact steps in 2k8, as I've only had to do it once, but in 2k5 you had to open the SQL Server Configuration Manager, select SQL Native Client Configuration, Client Protocols, and enable TCP/IP and Named Pipes - it's a similar process for 2k8 as I recall.
The connectionStringName used in the membership Tag should be changed to the present connection string where you have the membership tables created.
If the connectionStringName is not pointing to a valid connection String name in the connectionStrings tag, the membership tables can not be used by the application.

Resources