I am connecting to the database with the code below
string connString = @"Data source = test2 ; Database=test1data ; User Id=a ; Password=test1234";
using (SqlConnection sqlConn = new SqlConnection(connString))
{
string sqlQuery = @"SELECT * from Zone";
SqlCommand cmd = new SqlCommand(sqlQuery, sqlConn);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable table = new DataTable();
da.Fill(table);
dataGridView1.DataSource = new BindingSource(table, null);
}
But I wanted to create a file to connect that could be changed.
For example:
I'm connecting to a database, but changing this file I'll connect to another database