I'm currently studying C#, and i'm fairly new to .NET programming. I've been trying to create a client server (desktop) application to connect to a database. However there are some things i don't quite understand. I was hoping someone can answer some of my questions.
I've read that it's better to separate between user interface logic and data access logic. So I tried to create a data access class library (ex. applicationDAL.dll) using a strongly typed datasets (dragging tables from the data sources) and then just add a reference to this .dll in my main application (ex. mainApplication.exe).
Here's the thing, in my applicationDAL project, there's this app.config file. It has the connection string needed to connect to the database. The connection string contains values such as "data source = (local); integrated security ... ".
- What if I wanted to change the data source value to another machine after deployment (ClickOnce)?
- Should I use static methods in this class so that i can retrieve data easily without creating any instances of this class in my main application? or is there a better way to retrieve the data?
- If I deploy my main application using ClickOnce, will the .dll file be included in the application, or should I copy the .dll file manually in the installation folder? The same question goes for the app.config file.
I'm currently using visual c# 2008 express edition and sql server 2005 express edition. Any help is appreciated. Thx guys (and girls). ^_^