I receive the following errors when I attempt to connect to a SQL Server database on my home computer:
1) Keyword not supported: 'intigreted security'?
2) 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)
This is the code of ado.net that I want to connect with:
SqlConnection connection = new SqlConnection();
connection.ConnectionString = "Data Source=Local Host;Initial Catalog=AdventureWorks;";
connection.Open();
SqlCommand cmd = new SqlCommand("Select * from emp_", connection);
SqlDataReader myReader = cmd.ExecuteReader();
while(myReader.Read())
{
comboBox1.Items.Add(myReader[0].ToString());
Software/Hardware used:
ASKED:
July 16, 2009 3:22 PM
UPDATED:
July 21, 2009 4:14 PM