0

We have 2 physical servers, one the first one we have Windows Server 2008 with IIS 7, on the second server we have Windows Server 2008 with SQL Server 2008.

The application is an ASP.NET MVC 3 (using .NET 4.0 then). The application pool uses use .NET frmework 4.0 in mode "Integrated" mode, identity "NetworkService"

In "IIS maanger",in the three pane, I have Sites\Default web site\MyWebSite when I do a browse I receeive an error : The server was not found or was not accessible, allow remote connections, (provider:SQL Network Interface, error : 26 - Error Locating/Instance specified)

From the IIS server, I tried a "Telenet serverSQLname 1433" and that's work

In the connectionstring of NHibernate, I have this :

Data Source=SERVERDBNAME;Initial Catalog=MyDatabase; Initial Catalog=MyDB; 
User Id= MyUser; Password=MyUser; Integrated Security=True

I tried several syntax but same result.

I created the user "MyUser" in SQL Server.

I created a connection string in IIS, but don't know if it's useful

I open to try your solutions :) This kind of job it's not my job at all, I'm just a developer :)

Thanks,

1
  • I can just guess but i see two things: Data Source is not the name of the db but the name or ip of the server. You can even set a portnumber here(comma seperated as far as i know). Integrated Security=True would use a Windows User not a DB user so if MyUser is a DB-User you should set this to false. Try to search for NHibernate connection strings on the net there are several examples. Commented May 13, 2011 at 9:29

1 Answer 1

1

In your connection string, use integrated security, or username

Data Source=SERVERDBNAME;Initial Catalog=MyDatabase; Initial Catalog=MyDB; User Id= MyUser; Password=MyUser;

Data Source=SERVERDBNAME;Initial Catalog=MyDatabase; Initial Catalog=MyDB; Integrated Security=True

Also, use instance name if it applies :

Data Source=SERVERDBNAME\INSTANCENAME;Initial Catalog=MyDatabase; Initial Catalog=MyDB; Integrated Security=True

Finally, make sure that tcp/ip is enabled :

  • Go to SQL Server Configuration Manager, on the server hosting SQL Server
  • Go to SQL Server Network Configuration
  • Go to Procotols for SQL Server
  • TCP/IP : set to enable
Sign up to request clarification or add additional context in comments.

5 Comments

can you connect to the db server using SQL Server management studio ?
I think it's more a problem (configuration, user and/or in IIS and/or SQL Server)
does the sql server have an instance ? did you connect using login/password you provided ? did you connect remotely ?
@mathieu, yes when I use the "SQL manager" (the one where SQL server is installed) it's ok. From the Server from IIS, I can't because .... I don't have SQL MAnager
@mathieu, was enable. In the Configuation manager in the "SQL Server services", "MSSQLServer" "log on as" is set to "local" and "SQL Server Browser is set to "NH Authority\LocalService"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.