I am very new to C#. Below is the program which i am trying.
string connstring = "Data Source = .\\SQLEXPRESS;Initial Catalog = SAMP; Integrated Security = True";
SqlConnection conn = new SqlConnection(connstring);
SqlCommand comm = new SqlCommand();
comm.Connection = conn;
SqlDataAdapter myadapter = new SqlDataAdapter(comm);
DataSet myset = new DataSet();
comm.CommandText = "Select * From EMP ";
dataGridView1.DataSource = myset;
dataGridView1.DataMember = "EMP";
But I am getting following error. I am using sql server 2005 express edition.
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: 26 - Error Locating Server/Instance Specified)
Pls anybody provide me some solution.