开发者

Configuration IIS, SQL Server for ASP.NET MVC with NHibernate

开发者 https://www.devze.com 2023-03-05 09:41 出处:网络
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.

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\De开发者_开发技巧fault 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,


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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号