Oracle connection works on one server but not another - c#

I have an ASP.NET (4.0) application developed in Visual Studio 2012 (C#) with an Oracle (4.121.1.0) connection. A connection string is used so we are not looking at TNS.
The application runs without issue in debug on my development server (Windows 2008 R2 SP1), where I have the Oracle DataAccess components.
I can publish the project to my Production server (Windows 2008 R2), running IIS, but had to place the following dlls into the bin folder of the application.
oci.dll
Oracle.DataAccess.dll (published with application)
orannzsbb12.dll
oraocci12.dll
oraociei12.dll
oraons.dll
OraOps12.dll
I created an application pool for this app using 4.0 integrated and set "Enable 32-Bit Applications" to true.
The oracle connection runs successfully on this environment.
But now, when I publish the exact same code to my Test server (Windows 2008 R2 SP1), and copy the same dlls to the bin folder and set up my application pool the same as my production environment, I get:
The provider is not compatible with the version of Oracle client
This is the line of code that errors out on the TEST server:
oracleConnection = new OracleConnection();
I've verified that everything is the same between both PROD and TEST servers, but the TEST server gives me this error WITHOUT EXCEPTION and the PROD server runs PERFECTLY.
Neither PROD nor TEST servers have the Oracle DataAccess components installed.
Any suggestions on what to check?
Thanks.

Based on Mason's suggestion, I converted to the Oracle Managed Data Access driver which resolved the problem. So much simpler and resolved the issue.

Related

Can’t open SQL .MDF file because it’s version 852

I’ve created a C# application and have published it. I tested the published application on my own computer and everything was working properly. When I installed the app on my client’s computer that has the same SQL Server version installed as mine, when I want to open the app, I get this error:
Can’t use or open database because it’s version 852
and this machine supports 706 or earlier.
I’ve installed SSMS, SQL Server Express, a higher version (2017) of SQL Server, but none of the above helped. I’m frustrated, what can I do?
My App.Config file is like this:
Data Source=(LocalDB)\MSSQLLOCALDB;AttachDbFileName=|DataDirectory|\SLApp.mdf;Integrated Security=True;
Everything works fine on my computer with the config mentioned above. Now what can I do?

ClickOnce application using SQL Server database

I'm trying to learn how to create a simple application using Visual Studio IDE in C#.
I wrote a little application that uses a local SQL Server database for reading and storing data. On my machine, the program seems to work normally, but when trying to install the application on client computer it seems unable to read from the database.
I've tried to include the following prerequisites to the publish properties but it doesn't work:
Microsoft .NET Framework 4.5.2
SQL Server 2012 Express LocalDB
Any ideas about the right way to do it?
Thanks to all.
You need to install SQL Server Express LocalDB (SqlLocalDB.MSI) on the computer you are deploying your ClickOnce application to.
Selecting "SQL Server Express LocalDB" in the Prerequisites window and using "Download prerequisites from the component vendor's web site" should take care of that:
If you do that it should install the LocalDB for you and any database errors are more than likely resulting from connection string errors or leaving Integrated Security enabled.
You need to test on a target computer which does not have "SQL Server Express LocalDB" installed and verify that after the ClickOnce deployment it is installed. This will confirm that the problem is not the missing prerequisites but the database access issues...

Deploying C# SQL Server SMO application

Forgive me if this is not the correct forum for this ask but I have a c# application that uses SMO to setup a database on a remote server. I am wondering how to deploy this application as it works fine on my dev server but when I deploy it is missing batchparser and batchparser.client.dll files. They exist in the bin folder and I have referenced them by installing the Microsoft.SqlServer.SMO nuget package.
According to the official documentation:
Beginning with SQL Server 2017 SMO is distributed as the Microsoft.SqlServer.SqlManagementObjects NuGet package to allow users to develop applications with SMO.
This is a replacement for SharedManagementObjects.msi, which was previously released as part of the SQL Feature Pack for each release of SQL Server. Applications that use SMO should be updated to use the NuGet package instead and will be responsible for ensuring the binaries are installed with the application being developed.
I would assume this to mean I should be able to install the nuget package and all should be referenced correctly. Am I missing something big here? Does SQL Server need to be installed on the machine I am running my C# application from?
My architecture is as follows:
Web server
SQL Server
Web admin logs into (1) web server and runs my c# program which sets up some IIS based .net websites on that machine, then from the web server it will REMOTELY setup a database by running the smo commands. The C# program will execute the commands on the web server and remotely configure a SQL Server (2)(another machine).
Can this be achieved using C# and SMO without having an instance of SQL/SQL tools on the web server?
Thanks

Hosting an Asp.Net MVC 4 application on windows server 2012 with IIS8 from a Local Machine

I have developed an MVC 4 application on my personal laptop and would like to host it onto a windows 2012 server so that it goes live.
What I am doing right now is, I have published the application as a File System in my laptop and then remote logged in to the windows 2012 Server and trying to deploy it into IIS 8 which is on that server but I could find a way to import my application into the server.
Now, my question is do I need to install Visual Studio 2012 on the server and then copy my application over to it and then publish and deploy or is there any other way.
This is the first time I am deploying and hosting an application. So, I am not sure of the exact procedure to do it.
Remember that my development machine is not the windows server but it is my personal laptop.
Install WebDeploy (a free Microsoft Tool) on your target server. Then you can deploy your site directly from VS. See details here

Installing MS SQL 2005 drivers for IIS 7.5 .NET apps

I don't normally do .NET development but I have a small .NET app that I need to set up on a new Win2K8 IIS 7.5 server, the SQL 2005 server is on a different box. I've tested the .NET app on an Win7 IIS 7/SQL 2005 machine and it works fine. When I run the app on the new server I get the following error:
The 'SQLNCLI11' provider is not registered on the local machine.
I googled the error and found out that I needed to install the native client drivers. I found the sqlncli.msi file on the database server and installed it on the IIS server. Same problem.
I then installed the SQL Management Studio thinking that might have some drivers that it needed. Same error. I can connect through the management studio but the .NET app keeps giving me the same error.
Any suggestions?
Thank!
I changed the provider in my connection string from SQLNCLI11 to SQLNCLI10.
Works like a charm.

Categories