Connect to SQL Server 2008 and read from table?
For several days now I have been reading and searching for how to connect to the database and read fron the table. But there are so much info from all kinds of sources I, as a beginner, can't get what to use. Therefor I just need som help with the code to get going and get a sign that the communication with the database works and get rid of some anxiety.

I have created the DataAcess class to work like a manager and first of all I wonder where I should place the connection, in the constructor or just in the beginning of the class? And what details I'm going to use in the connection. My database is .mdf file. Should I use the connection string from the app config file?

Can I also get som help how I should code to read from a column in the table?

In the long run I'm going to use a dataset, but I have to start like this and advance in small steps. Help is preciated! Thanks! :)

EDIT:
In my instructions I'm told not to use hard coded file path of the connections string. I guess then I must use the app.config file that Visual Studio has created, but how?
Connect to SQL Server 2008 and read from table?
===

For several days now I have been reading and searching for how to connect to the database and read fron the table. But there are so much info from all kinds of sources I, as a beginner, can't get what to use. Therefor I just need som help with the code to get going and get a sign that the communication with the database works and get rid of some anxiety.

I have created the DataAcess class to work like a manager and first of all I wonder where I should place the connection, in the constructor or just in the beginning of the class? And what details I'm going to use in the connection. My database is .mdf file. Should I use the connection string from the app config file?

Can I also get som help how I should code to read from a column in the table?

In the long run I'm going to use a dataset, but I have to start like this and advance in small steps. Help is preciated! Thanks! :)

EDIT:
In my instructions I'm told not to use hard coded file path of the connections string. I guess then I must use the app.config file that Visual Studio has created, but how?