Exemplo n.º 1
0
 private void InitializeConnectionString()
 {
     try
     {
         ConnectionStringSettingsCollection csSection = ConfigurationManager.ConnectionStrings;
         m_connectionString = csSection["pgsqlconn"].ConnectionString;
         dbSelectedName = GetDatabaseName(m_connectionString);
         layer = new BusinessLayer(m_connectionString);
         lblServerDetails.Text = m_connectionString;
     }
     catch (Exception exc)
     {
         throw new Exception(exc.Message);
     }
 }
Exemplo n.º 2
0
 //public void threadAction(object sqlStatement)
 //{
 //    var watch = Stopwatch.StartNew();
 //    DataTable tbl1 = (DataTable)layer.ExecuteBatch(sqlStatement.ToString());
 //    watch.Stop();
 //    MessageBox.Show("completed sql statements "+ watch.ElapsedMilliseconds.ToString() + " ms");
 //}
 private void cmbDatabases_SelectedValueChanged(object sender, EventArgs e)
 {
     if (cmbDatabases.Text != dbSelectedName)
     {
         //trebuie sa schimbam stringul de connection se baza selectata
         string dbNewName = cmbDatabases.Text;
         m_connectionString = m_connectionString.Replace(dbSelectedName, dbNewName);
         lblServerDetails.Text = m_connectionString;
         layer = new BusinessLayer(m_connectionString);
         dbSelectedName = dbNewName;
     }
 }