title: How to connect a database to website using LINQ and dbml file
body: <p>I am new to SQL server and trying to make a very simple website which will record  usernames and passwords from clients into a database. I have created a database project with a table of users: <em>user name</em> and <em>password</em>. I built a website with a page containing <code>user name</code> text field, <code>password</code> text field and a <code>login</code> button. All I want is to record the usernames and passwords the users are entering (as simple as that). I want to do it via sql connection using LINQ-to-SQL. I know that I have to create SQLConnection class, create a dbml file and attach my database to it. I am having trouble creating a dbml file of my database and attaching my database to it in Visual Studio 2013. Can anyone please give direction to do so?</p>
  
  <p>So far I have this class for the login page:</p>
  
  <pre><code>public partial class Login : System.Web.UI.Page
  {
      protected void Page_Load(object sender, EventArgs e)
      {
  
      }
      protected void Button1_Click(object sender, EventArgs e)
      {
          string connStr = "data source=.; database = AuroraDB; integrated security=SSPI";
          SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["TODO"].ConnectionString);
  
          try
          {    
  
          string insertQuery = "insert into Users (Username, Password,) values(@uname , @password)";
          SqlCommand command = new SqlCommand(insertQuery, connection);
          command.Parameters.AddWithValue("@uname", UserNameTextBox.Text);
          command.Parameters.AddWithValue("@password", PasswordTextBox.Text);
          connection.Open();
          command.ExecuteNonQuery();
          Response.Write("Loggin was successful!");
  
          }
          catch(Exception exception)
          {
              Response.Write("Error occurred: " + exception.Message);
          }
          finally
          {
              connection.Close();
  
          }
      }
  }
  </code></pre>