This is one of the very basic thing. I suggest you to spend sometime learning ASP.NET before you start the project.
I am saying this because even if I give you the code for your above requirement, I am sure you will come again and again with a new simple issue. You won't be able to complete the project in time.
So it's better to spend sometime understanding the basics and then start developing.
There are lots of tutorial available on the web. The best place to start is
http://www.asp.net/[
^].
Data-access tutorials can be found here:
http://www.asp.net/data-access/tutorials[
^]
You will find the answer for your above query here:
http://www.w3schools.com/aspnet/aspnet_dbconnection.asp[
^]
And last but not the least, take the maximum use of search engines like Google. Google is programmers best friend.
And for articles and tutorials CodeProject rocks. You can find anything and everything here.
I hope this helps.
Cheers!