public string GetConnString()
{
String _connstr_ = System.Configuration.ConfigurationManager.ConnectionStrings["myConnectionString"].ToString();
return _connstr_;
}
public void ExecuteSQL(string SQL)
{
String ConnStr = GetConnString();
using (OleDbConnection conn = new OleDbConnection(ConnStr))
{
OleDbCommand cmd = new OleDbCommand(SQL,conn);
cmd.Connection = conn;
conn.Open();
cmd.ExecuteNonQuery();
cmd.Dispose();
conn.Close();
conn.Dispose();
}
}