try { //Setting private fields. this.strMdbFile = paramstrMdbFile; this.strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=;Data Source=" + paramstrMdbFile + ";"; /*Opening connection.*/ conDBData = new OleDbConnection(strConnString); conDBData.Open(); /* Some statements*/ conDBData.Close(); } catch (Exception ex) { string strError = ex.Message; MessageBox.Show(strError); } finally { if (conDBData != null) { if (conDBData.State == ConnectionState.Open) { conDBData.Close(); } } }
using
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)