title: c# database connection model
body: <p>I'm writing a web application in which users can register themselves and log in to a web site.</p>
  
  <p>I've got an ASP.NET web form with a series of text boxes and a submit button. When I did this same thing in PHP, when the submit button was pressed, a User class was created and the contents of the text boxes was passed to an addUser() function that took those parameters and inserted them into the database, and now I'm trying to do the same thing in C#. </p>
  
  <p>Ideally, I want to use an MVC type of design. The controller (the textboxes and button) should gather up the information in the text boxes, and pass it to the model (the User class), which should connect to the database and perform the necessary insert statement. How do I make a class connect to the database? What parameters does it need?</p>
  
  <p>Do I need an SqlDataSource object on the page that I pass to the constructor of the User class? Or something different?</p>