Quando stavo cercando di connettersi a SQL Server utilizzando il seguente codiceConnessione a SQL Server utilizzando l'autenticazione di Windows
SqlConnection con = new SqlConnection("Server= localhost, Authentication=Windows Authentication, Database= employeedetails");
con.Open();
SqlCommand cmd;
string s = "delete employee where empid=103";
ottengo il seguente errore:
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: SQL Network Interfaces, error: 25 - Connection string is not valid)
SQL non è configurato per consentire le connessioni remote. – Greg
è localhost, non molto remoto. – ps2goat
Buon punto. La stringa di connessione è sbagliata. – Greg