public static ConnectionManagerV2 GetConnectionManager() { if (connectionManager == null) { connectionManager = new ConnectionManagerV2(); } return(connectionManager); }
void Refresh_Connection() { var conns = ConnectionManagerV2.GetConnectionManager().conn_list .Values .Where(x => x.IsConnectionActive) .ToList(); if (conns != null && conns.Count > 0) { cmb_connections.DataSource = conns; cmb_connections.DisplayMember = "Name"; cmb_connections.ValueMember = "ID"; } }
private void button4_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(textBox1.Text) && !string.IsNullOrEmpty(textBox2.Text)) { try { ConnectionManagerV2.GetConnectionManager().SaveConnection(textBox2.Text, textBox1.Text); MessageBox.Show("Connection Added"); } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
private SQLiteConnection GetConnection(int Id) { return(ConnectionManagerV2.GetConnectionManager().GetConnection(Id).GetActiveConnection()); }
public frmMain() { InitializeComponent(); obj_sql = new SQLWorker(); connectionManager = ConnectionManagerV2.GetConnectionManager(); }