title: Insert data into a SQL Server database using ASP.NET is not working
body: <p>I wrote code to insert data into the database, after I click the insert button, nothing happens and there is no error. Please I need help.</p>
  <p>If I click the insert button from the front end, it is supposed to populate the database.</p>
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  using System.Data.SqlClient;
  
  namespace insertAdo
  {
      public partial class TableInsert : System.Web.UI.Page
      {
          protected void Button1_Click(object sender, EventArgs e)
          {
              string connectionString;
              SqlConnection cnn;
  
              connectionString = @&quot;Data Source=DESKTOP-5JPBK1L;Database=StudentDB; Integrated Security=SSPI&quot;;
  
              cnn = new SqlConnection(connectionString);
  
              cnn.Open();
              {
                  SqlCommand command;
                  SqlDataAdapter adapter = new SqlDataAdapter();
                  String sql = &quot;&quot;;
  
                  sql = &quot;INSERT INTO  student_table (Student_id, name, Email, Join_date) VALUES (102, 'Jaja Peter', 'Jaja.Peter@gmail.com', '09/30/2021')&quot;;
  
                  command = new SqlCommand(sql, cnn);
                  adapter.InsertCommand = new SqlCommand(sql, cnn);
                  adapter.InsertCommand.ExecuteNonQuery();
  
                  command.Dispose();
              }
  
              Response.Write(&quot;Insert successful&quot;);
              cnn.Close();
          }
      }
  }
  </code></pre>