-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
48 lines (44 loc) · 1.43 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using FrbaHotel.AbmRol;
using System.Data.SqlClient;
using System.Configuration;
namespace FrbaHotel
{
static class Program
{
/// <summary>
/// Punto de entrada principal para la aplicación.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
try
{
using (SqlConnection connection = new SqlConnection(ConfigurationManager.AppSettings["BaseLocal"]))
{
connection.Open();
connection.Close();
}
Application.Run(new PantallaPrincipal());
}
catch (SqlException exc1)
{
MessageBox.Show(exc1.Message, "Error de conexión con la base.", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
catch (InvalidOperationException exc2)
{
MessageBox.Show(exc2.Message, "Error de conexión con la base.", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
catch (Exception exc3)
{
MessageBox.Show(exc3.Message, "Error general.", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}