Beispiel #1
0
 private void GetData(string sqlQuery, DataTable table)
 {
     try
     {
         ConnectDB(sqlQuery);
         _dataAdapter.Fill(table);
         _dbaseConnection.Close();
     }
     catch (Exception)
     {
         DataGetError?.Invoke(this, EventArgs.Empty);
     }
 }
Beispiel #2
0
 private void GetSettings(Dictionary <string, string> dictionary, string SQLQueries)
 {
     try
     {
         DataTable table = new DataTable();
         GetData(SQLQueries, table);
         dictionary.Clear();
         foreach (DataRow row in table.Rows)
         {
             dictionary.Add(row[1].ToString(), row[0].ToString());
         }
     }
     catch (Exception)
     {
         DataGetError?.Invoke(this, EventArgs.Empty);
     }
 }