I am getting below exception while connecting ASP.NET with SQLSERVER using below connection strings.i tried two methods.
Exception
An exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll but was not handled in user code
Additional information: 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
Connection String
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con;
con = new SqlConnection("Server=ADMIN/SQLEXPRESS,Database=test,integrated security=true");
con.Open();
}
(or)
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con;
con = new SqlConnection("Server=localhost;Database=test;integrated security=sspi");
con.Open();
}
i am connecting SQLSERVER directly by using below server name in windows authentication.It is connecting well but it is not connected from asp.net
Server Name:ADMIN\SQLEXPRESS