private static void UpdateValue(string commandText) { using (OleDbConnection connection = ConnectionRepository.GetDataConnection()) { connection.Open(); OleDbCommand cmd = new OleDbCommand(commandText, connection); cmd.ExecuteNonQuery(); } }
public static DataTable GetCategories() { DataTable dataTableCategories = new DataTable(); using (OleDbConnection connection = ConnectionRepository.GetDataConnection()) { OleDbDataAdapter adapter = new OleDbDataAdapter(string.Empty, connection); adapter.SelectCommand.CommandText = "SELECT [CategoryID], [CategoryName] FROM [Categories]"; adapter.Fill(dataTableCategories); } return(dataTableCategories); }