string connectionString = ConfigurationManager.AppSettings["ConnectionString"];
this._connection = new SqlConnection(connectionString);
try
{
this._connection.Open();
}
catch (Exception exception)
{
this.MainPanel.Controls.Add(Tools.TextLabel("Error connecting with database: <br />" + exception.Message, Color.Red, 15));
Debug.WriteLine("error connecting to database: " + exception.Message);
Debug.WriteLine("connection string: " + connectionString);
}