سلام، این کلاس های من برای اتصال به پایگاه داده access هست :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;
using System.Data;

namespace ZikoLibrary
{
class addDB
{

public void add(string query)
{

string s = "Data Source=.;Initial Catalog=ZikoLibrary;Integrated Security=True";
SqlConnection sqlConn = new SqlConnection(s);
SqlCommand sqlComm = new SqlCommand();
sqlComm.Connection = sqlConn;
sqlComm.CommandText = query;
sqlComm.CommandType = CommandType.Text;
sqlConn.Open();
sqlComm.ExecuteNonQuery();
sqlConn.Close();
}
}
}




توی یک فرم هم قراره یک نام فرستاده شود، و پارامتر اولش هم که ID هست. ولی برنامه رو اجرا می کنم اروری نمی ده ولی وقتی اطلاعات رو ثبت می کنم، انگار برنامه هنگ می کنه و و بعد از مدتی به
sqlConn.Open();
گیر می ده :
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)