title: Insert Text from Textbox Into Database
body: <p>I'm trying to add the values / the text the user input from my textboxs into my database.</p>
  
  <p>At the moment I can't get the code to insert the values to the sqldatabase.</p>
  
  <p>Here is my aspx Code</p>
  
  <pre><code>&lt;asp:TextBox ID="txt_WineName" runat="server" PlaceHolder="WineName" /&gt;
  &lt;asp:TextBox ID="txt_WineYear" runat="server" PlaceHolder="WineYear" /&gt;
  &lt;asp:TextBox ID="txt_WinePrice" runat="server" PlaceHolder="WinePrice" /&gt;
  &lt;asp:TextBox ID="txt_WineType" runat="server" PlaceHolder="WineType" /&gt;
  &lt;asp:Button ID="btn_AddWine" runat="server" Text="Add" /&gt;
  </code></pre>
  
  <p>Here is my C# code:</p>
  
  <pre><code>protected void btn_AddWine(object sender, EventArgs e)
  {
      using (SqlConnection connection = new SqlConnection("Data Source=PCM13812;Initial Catalog=Kronhjorten;Integrated Security=True"))
      {
          connection.Open();
          string query = "SELECT * FROM Wines";
          using (SqlCommand command = new SqlCommand(query, connection))
          { 
              using (SqlDataReader reader = command.ExecuteReader())
              {
                  while (reader.Read()) 
                  {
                      string Name = txt_WineName.Text;
                      string Year = txt_WineYear.Text;
                      string Price = txt_WinePrice.Text;
                      string Type = txt_WineType.Text;
                      Sql_Insert.Insert();
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>I tried other links from stackoverflow but can't seem to find anything that makes this work.</p>
  
  <p>Hope you can help me. I'm sorry if I'm doing this in a strange way.</p>