0

I have write one .Net application in C# I use these strings to connect

str = "Data Source=200.1xx.2yy.1zz ;Initial Catalog =minofom;uid =sa;pwd = abuelita";

and the same string for app.config:

<add name="MiniFinan.Properties.Settings.MiniFimConnectionString"
  connectionString="Data Source=200.1xx.2yy.1zz ;Initial Catalog =minofom;uid=sa;pwd = abuelita" providerName="System.Data.SqlClient" />

All the forms open fine, when I'm out of the local network, the app and the reports work perfect, but when I install the app in the server or any machine of the local network the app show me this error:

“Named Pipes Provider, error: 40 - Could not open a connection to SQL Server”</p>

The local server is a domain controller, I use this string for local area network:

str="Data Source=192.168.2.254 ;Initial Catalog =MinoFom;uid =sa;pwd = abuelita"

All the forms work, but when I call to any report not connect, I use the same string for the app.config. I have tested the same app in other Server 2003 (not Domain Controller) and the reports works, have any way of write the string for domain, any idea of how to fix this?

I have checked SQL Browser is online, the protocols : Shared Memory/ Named Pipes/TCPIP are installed and work. I think is something with the domain.

4

1 回答 1

0

我已经解决了使用两个字符串的形式:

str = @"Data Source=TORRE ;Initial Catalog =minofom;uid =sa;pwd = abuelita";

和 app.config 中的其他报告:

 connectionString="Data Source=MyDomain\TORRE;Initial Catalog=MinoFom;uid =sa;pwd = abuelita"

它可以在 app.config 中保存多个字符串,享受

于 2013-03-26T20:14:19.500 回答