private void cbDataType_SelectedIndexChanged(object sender, EventArgs e) { DBType val = (DBType)cbDataType.SelectedIndex; cbDataType.SelectedIndex = (int)val; var dbProperties = new DBProperties(); dbProperties.DBType = val; }
static void Main(string[] args) { DBType d = (DBType)2; DBProperties p = new DBProperties(); p.DBType = d; Console.WriteLine((int)p.DBType); //outputs 2 Console.ReadLine(); }
public EasyDataBaseModel(DBProperties dBProperties) { string connoectionString = $"Data Source={dBProperties.DataSource};" + $"Initial Catalog={dBProperties.InitialCatalog};" + "Integrated Security=SSPI;"; sqlConnection = new SqlConnection(connoectionString); sqlConnection.Open(); }
public DomainModel(DBProperties dBProperties) { try { easyDataBaseModel = new EntityDataBaseModel(dBProperties); log.LogInformation("Connected to DataBase"); } catch (Exception ex) { log.LogError(ex.Message); } IDictionary <int, string> dictOfAvailiablePhones = easyDataBaseModel.GetListOfAvaliablePhones(); regular = new RegularParser(); phoneChecker = new PhoneChecker(dictOfAvailiablePhones); }
public SqlConnector(string dbPropertiesJson) { _dbProperties = JsonConvert.DeserializeObject <DBProperties>(dbPropertiesJson); }
public EntityDataBaseModel(DBProperties dBProperties) { _conectionString = SetupConnections(dBProperties.DataSource, dBProperties.InitialCatalog); }