static void Main(string[] args) { // Application.EnableVisualStyles(); //Application.SetCompatibleTextRenderingDefault(false); // Application.Run(new SplashScreen()); ShowSplash(); Thread.Sleep(2000); PreviewExcelFile mainForm = new PreviewExcelFile(); Application.Run(mainForm); }
//Redirect us to the ExcelFilePreview when login button is clicked private void buttonLogIn_Click(object sender, EventArgs e) { this.Hide(); PreviewExcelFile excelFile = new PreviewExcelFile(); excelFile.ShowDialog(); //remember to add: //1. Server Explorer > Data Connection > User Database //2. Add a connection string to the database in App.config //3. Ask IT to create for me a view with the login details of finance/accounting that i can query //SqlConnection con = new SqlConnection("put the connection string in here"); //SqlDataAdapter sda = new SqlDataAdapter("Select Role from Login where Username ='******' and Password='******'", con); //DataTable dt = new System.Data.DataTable(); //sda.Fill(dt); }