Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 124939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:04:47+00:00 2026-05-11T05:04:47+00:00

Sorry if this is the most seen question on the web, but this is

  • 0

Sorry if this is the most seen question on the web, but this is my turn. I am trying to publish my asp.net mvc app on IIS 7 under MS Sql Server 2008. I am on a Windows Server 2008 virtual machine. I get the following classical error:

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: 26 – Error Locating Server/Instance Specified)

Under SQLServer, Allow remote connections is checked. My connection string is:

Data Source=.\MSSQLSERVER;Initial Catalog=mydbname;User Id=sa;Password=mypassword

I also tried with no username/password and ‘Integrated Security=true’. There is only one instance of SQLServer installed. I tried to access my web page locally and remotely. There is no active firewall on the virtual machine.

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T05:04:48+00:00Added an answer on May 11, 2026 at 5:04 am

    Thanks guys for the try. I found the solution and it is related to an info that I forgot to give. I hope it can help someone as new as me on these things.

    I use NHibernate, and the connection string is actually in the nhibernate.cfg.xml file. The one in the web.config file is actually used by my various providers (users/roles). I fixed that by removing the connection string from the NH config file. I now retrieve it with:

    string connectionString = ConfigurationManager. ConnectionStrings['myConnectString'].ConnectionString; 

    and I set it in NH with:

    Configuration cfg = new Configuration(); cfg.Configure(cfgFile); cfg.SetProperty(NHibernate.Cfg.Environment.ConnectionString, connectionString); 

    Now I get:

    Cannot open database ‘mydb’ requested by the login. The login failed. Login failed for user ‘NT AUTHORITY\NETWORK SERVICE’.

    But this is another story, for another question if I can’t find the answer.

    PS: I had to use ‘.’ as the server name otherwise .\MSSQLSERVER was producing a new error ‘invalid connection string’. Thx Ian and Jared for the tip.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry this is a basic question, but all my research just barely missed answering
sorry this is such a simple question but I can't figure it out. How
Sorry if this is a really basic question but it's been really getting to
Sorry if this question is too vague, but I'd rather not muddy it's point
Sorry for this long post. The question is however small but requires full detail.
Sorry if this is a simple question, but I've only recently started learn coding
Sorry if this is a bit of a noob question but I am still
I'm sorry if this seems like a random question, but I have a database
Sorry this is not a very well defined question, I am thinking about an
Sorry this is probably super basic. But in all my javabean examples, I've not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.