I was just wondering ... when my (small & new) Project starts up, I have this code right near the start (This is a "Method", is that right ?) :
SqlConnection cs = new SqlConnection(@"Data Source=MEDESKTOP;AttachDbFilename=J:\Users\Gary\Documents\Visual Studio 2010\Projects\KALeagueCup\KALeagueCup\KADatabase.mdf;Initial Catalog=myKADB;Integrated Security=True");
SqlDataAdapter da = new SqlDataAdapter("SELECT * FROM LEAGUES", cs);
DataTable dt = new DataTable();
for (int i = 0; i < dt.Rows.Count; i++)
Could this code be kept elsewhere and "Called" from here and from anywhere else if I wanted to re-display the original form, or am I thinking too much like a Mainframe programmer again ?!?!?