same place where you globally add variables ... just under
public Form1()
{
InitializeComponent();
}
SqlConnection cn = new SqlConnection(@"Connection string");
this although just global for this form, if you want to put it over all for all forms
public Form1()
{
InitializeComponent();
}
public SqlConnection cn = new SqlConnection(@"Connection string");
but i would not use put a connection string as public ... id rather get a get set method going
if you want to change it you only need to call the name you alreaddy set and call new connection like
cn = new SqlConnection(@"new Connection string");