-1

I have an application hosted in a server. Database is being uploaded to the server also. When I try to run the website this error showed up:

The system cannot find the file specified

After some research I came to know that this error might be related to the instance name or the database is not accessible. But when I try from my local host with Visual Studio with the same database connection string it runs perfectly.

What can be the possible reason for this strange behavior?

I am developing a SASS application. The database connection string is chosen dynamically according to the appSettings in web.config file. Is this can be the issue?

Code Sample:

<appSettings>
   <add key="myDomainName" value="myDomainName" />
   <add key="localhost:1234" value="MyConnectionString" />
</appSettings>
Bender the Greatest
  • 17,062
  • 18
  • 82
  • 145
Nayem_43
  • 194
  • 1
  • 6
  • 1
    [Please do not upload images of code/data/errors when asking a question.](//meta.stackoverflow.com/q/285551) (Though please do *not* post the full stack.) – Larnu May 23 '22 at 08:47
  • To address one of the errors in the stack: Does this answer your question? [Cannot Connect to Server - A network-related or instance-specific error](https://stackoverflow.com/questions/18060667/cannot-connect-to-server-a-network-related-or-instance-specific-error) – Larnu May 23 '22 at 08:48
  • @Larnu i think this error different from mine. There is a message in my error page like this "provider: SQL Network Interfaces, error: 52 - Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly installed and that the Local Database Runtime feature is enabled." Should i install SQL express into my live server? Or what is "Local Database Runtime installation" actually? – Nayem_43 May 23 '22 at 09:03
  • Are you sure it's a different [error](https://i.stack.imgur.com/ovsui.png)? – Larnu May 23 '22 at 09:04
  • @Larnu I think yes. Cause that error is specified as "Could not open a connection to SQL Server". But my error say something like it missing a program or a feature. But i.m not clear what is it? – Nayem_43 May 23 '22 at 09:06
  • *"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections."* and [error](https://i.stack.imgur.com/ovsui.png) look the same to me; but I can't fully validate they are the same as I can't copy and paste text from an image. – Larnu May 23 '22 at 09:07
  • @Larnu, Here is the full error mesaage that i got "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 52 - Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly installed and that the Local Database Runtime feature is enabled.)" – Nayem_43 May 23 '22 at 09:10

0 Answers0