من برای remot وصل شدن کد زیر رو نوشتم ولی خطا گرفت
using (SqlConnection connection = new SqlConnection("Data Source=172.16.18.229;Initial Catalog=BookDB;Integrated Security=True;User ID=sa;Network Library=dbmssocn"))
{
connection.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: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)