Installing MS SQL 2005 drivers for IIS 7.5 .NET apps - c#

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.

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...

Oracle connection works on one server but not another

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.

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

Transfer from SQL Server 2005 to 2012

I use an intranet tool that has a database created using VS 2005(UI) and SQL Server 2005 and it was working just fine on windows server 2003.
Now I have transferred the database to a Windows 2008 Server which has SQL Server 2012 installed. I changed the connection string, reference assemblies and debugged using visual studio, It works perfect( I am able to login and access the database ). But When I try to do the same in IE, I get userid incorrect error on the login page(first page of UI).
I do not get any connection errors or user errors from the server. The target framework was 2.0 on the previous version but I had to change it to 4.0 in here because the new environment didn't like 2.0. What should I do to solve this?

Categories