PDA

View Full Version : Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)



asilverisis
یک شنبه 01 دی 1387, 12:10 عصر
سلام
من یه برنامه نوشتم و بعد از publish که می خوام اون روی یک کامپیوتر دیگه اجرا کنم با یه مشکل مواجه شدم.
از SQlEXPRESS 2005 استفاده کردم. اون رو روی سیستم client نصب کردم.
توی برنامه ابتدا چک می کنم اگر دیتابیس نبود attach میکنم
با connection string دیتابیس خودم وقتی Connection.Open() اجرا می شه مشکلی نداره و خطایی نمیده یعنی احتمالا connection string درست اما وقتی می خوام یه دستور Select اجرا کنم با این خطا مواجه میشم.
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

سرویس های Named Pipes و TCP رو هم از توی Sql Server Configuration manager فعال کردم.
از توی Sql Server Surface Area هم Renmote Connection رو ولی بازهم درست نشد
اینم connection string :
Server=.\SQLEXPRESS;Initial Catalog=Confectionery;Integrated Security=True;User Instance=false;