public DBObject(DBConnectObject conn) { ConnectionObject = conn; Connection = new SqlConnection(ConnectionObject.MakeConnectionString()); try { Connection.Open(); Status = "Connected"; } catch (Exception ex) { Status = "Connection Failed: " + ex; } }
public void Connect(string Source, string Catalog, string UserName, string Password) { var connectObject = new DBConnectObject(Source, Catalog, UserName, Password); DB = new DBObject(connectObject); }