I have a small report/logging application written in C#.NET 4.0 and WPF that I would like to have users authenticate against an existing database table. I’ve come up with a general idea of how things might work out. I’m hoping to get some input or clarification on what to actually use to accomplish this.
So I suppose I will need to connect to the database and query agianst the input. I’ve already done some work with LINQ on Objects. So I think the query itself wont be that difficult. Although I will probably have to create a user with priveledges to do so.
I wondering how I would connect to the database and also how would I enter and store the database connection information (it may change from system to system).
I’m guessing the configuration file would be a xml file and I can store all of my necessarily information in that.
Lastly I’m wondering what the best way to have the Login / Password screen displayed. Should I make a pop-up that shows when the application is first run and then hide it after wards and set the Application to visible ?
Any Ideas or Guidance would be greatly appreciated.
Thanks in Advance
To connect to MySql you would need to use the Mysql Connector for .NET. Then you would need to put a connection string into your App.config file similar to the following:
Then you could use ADO.NET to issue your SQL queries. I’m not sure that you’ll be able to use Entity Framework to execute LINQ queries. You can find more info on the connection string here.
As for the login screen, you can pop it up while you load your main UI layout in the background. This is fairly standard behavior.