Novice user here. I want to be able to share this with all my forms. How do I add the code to the project?
private OleDbCommand GetCommand()
//set connection to Access 2007 database
OleDbConnection con = new OleDbConnection();
con.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=""" + AppDomain.CurrentDomain.BaseDirectory + @"Project.accdb""";
OleDbCommand cmd = new OleDbCommand();
cmd.Connection = con;