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

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

Related

MYOB ODBC ASP.NET application issues during insert command from IIS 10.0

I am trying to develop a ASP.NET Web API for MYOB that runs within IIS. That will allow me to insert/update/select different pieces of information from a MYOB company file.
At the moment within development everything works perfectly from within VS 2015 using IIS Express. I can successfully execute a insert command on the MYOB ODBC connection in multi-user access mode while the company file is opened by atleast two other users.
However when run from within IIS no errors are displayed. However the ODBC driver returns successfully on the insert query despite no insert being completed and no records of errors in any log files.
Finally, i have given the application pool connected to the IIS Application/Website the identity of the system administrator account. So i am assuming this is not the issue.
Could someone please help me on this! Have I maybe setup the permissions and security protocols in IIS incorrectly? As this application works fine within IIS Express but not in IIS?
Thanks in advance for any help!
You eventually couldn't see an error because you are using Web API. You are just a client. But maybe the API has an error that you've couldn't be seen. is your API has a LOGS? or it has a return value when it might encountered an error?
Try to Double Check it.
I agreed there's a big difference between iis express and IIS itself(Not in VS, means other machine or in server)
Check it too.
1.) framework you are working mostly.
2.) make sure that your Web API is running.
3.) IIS set up.

The 'msolap' provider is not registered on the local machine

tried looking at other examples on this and am a bit confused. I have 2 web servers that are load balanced and a sql server box (sql 2012). my cube is created on the sql server box (i see it in management studio). when i try to access via my asp.net page i receive the above error.
now, i see the msolap110.dll in C:\Program Files (x86)\Microsoft Analysis Services\AS OLEDB\110 on the sql box. do i need to do something permission wise with the dll or something? do i need to install analysis services on the web server? is there a specific port or something (doubtful as sql is running fine).
connection string is as follows:
"Provider=msolap;Data Source=;Initial Catalog=AutoOLAPAW;Cube Name=SampleCube;"
going to try to force to use MSOLAP.5 but waiting on a republish from our security/deployment group.
this all works fine in dev but my (more secured/stripped down) prod/qa is where i'm seeing the issue. using iis7 on both.
If you are using ADOMD.NET then either set CopyLocal=True on that reference on your ASP.NET source code so Microsoft.AnalysisServices.AdomdClient is deployed with the web app... Or install SQL_AS_ADOMD.msi from:
https://www.microsoft.com/en-us/download/details.aspx?id=49999
If you are using OLEDB then install SQL_AS_OLEDB.msi from that same link.
If you don’t want the SQL2012 version but want the latest then install from here and use Provider=MSOLAP in the connection string (instead of a number like MSOLAP.5).

Deploying website, error points to file on local pc, using Visual Studio 2012

I've created a website in Visual Studio 2012, now when I upload my files to the web server I receive an error whereby the system cannot find the file specified.
It seems to only happen on files which fetch data from a database.
I've tested my connection string and that seems to be working as I've close the connection as well as deleted the local db I was using. My site works fine when run locally, but the second I try access it online I get the same error.
Link to error image:- http://imgur.com/wkXV8fe
I've highlighted the error that puzzles me in the image. It keeps trying to find the file on my local pc it seems. I've searched through my code and can't seem to find anything that is hard coded.
Your help is much appreciated, hopefully someone has encountered and solved this problem.
The possible reason are,
The folder which containing specified file is may be read only or admin access or hidden in server machine. If possible, check the folder properties.
Make sure the file containing folder has uploaded or not on server.
It won't find your local pc if you hosted on other IP(server). The same root folder may be present on server side, so don't get confuse with server and local machine.
The "file not found" error is actually misleading, the error you need to deal with is the SqlException error and indicates the connection string is wrong - you need to update the connection string to access the SQL Server externally.
Are you also deploying the database to another server or are you attempting to access the same database as when testing locally? If you are accessing the same database locally, make sure the web server you are using to host the website can actually access the SQL Server on your local machine - check all firewalls and other things, and make sure that the SQL Server accepts TCP connections.

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

asp.net SQL Database File Error

We're getting the following error when trying to establish a connection to a database file in the project:
Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.
Any ideas on how we can fix it?
Thanks in advance!
http://jeremywadsworth.com/Default.aspx?blogentryid=56 has one possible fix.
http://forums.asp.net/t/1377174.aspx also has further discussion on the topic.
Hope that helps.
--
One more idea. I think I've encountered something like this when using Visual studio to create and access my database. You can detach your database file from visual studio and then directly attach it to your SQL server. I can't remember if the problem manifested in the same way or not but this should get you around the user instance issue. If this doesn't apply let me know and I'll see if i can come up with anything else.
If you are using IIS as the server,then this occurs because the server takes default asp.net database.
In IIS server,create your own application pool and run your app on that instead of using the default pool.
Check the permissions.Give full access control rights.
Also,
go to SQL server configuration>properties. Select local system in the built-in app.. And your new pool should also have local system selected.
This fixed the problem for me. Hope it works for someone here.
PS: If you are trying to making connectivity in Visual studio for android application,then close the visual studio before running it on android as the process wont complete if visual studio is open and will result into error.
SQL Express file attach starts a new 'user instance' SQL Server. This involves a new master/model/msdb/tempdb set of files that are created in the user settings data folder. also the startup of the new 'user instance' can take up to several minutes on extreme cases.
This MSDN article on SQL Server 2005 Express Edition User Instances cover in detail the process and luckly it has some Common Issues and fixes. The most common failure is due to access rights over the user settings copied files. You will usualy get details about the failure in your NT event log (ie. why did the child instance not start).
We got over this by copying the database from my machine to my team-mate's.

Resources