سلام من وقتی که برنامه رو اجرا می کنم تو کد پایین رو قسمت open گیر میده و این اشکالو میگیره :
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)
اینم کد برنامه :
private void Form1_Load(object sender, EventArgs e)
{
SqlConnection ado_bank= new SqlConnection();
ado_bank.ConnectionString = "server=localhost;database=E:\\Program\\librery\\b ank\\ebl_b.mdf;uid=sa;pwd=s;connection timeout=20";
ado_bank.Open();
}