title: Unable to insert record into the database
body: <p>I have the followind code in my .NET application</p>
  
  <pre><code>public string connectionString = "Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\Storage.mdf;Integrated Security=True;User Instance=True";
   string insertStatement = string.Empty;
              insertStatement = "INSERT INTO UserDetail(UserName, Password, IsRemember) Values('" + txtUserName.Text.Trim() + "','" + txtPassword.Text.Trim() + "','" + chkRemember.Checked + "')";
              SqlConnection con = new SqlConnection(connectionString);
              SqlCommand cmd = new SqlCommand(insertStatement, con);
              con.Open();
              int result = cmd.ExecuteNonQuery();
              con.Close();
  </code></pre>
  
  <p>Storgae.mdf is the database which I have attached to the project. It's in the root directory. </p>
  
  <p>Table structure</p>
  
  <pre><code>UserName NVarChar(50) NULL,
  Password NVarChar(50) NULL,
  IsRememberBit NULL
  </code></pre>
  
  <p>When I am running the query, it is returning <strong>1</strong> [No error, No exception] But when I checked into the database table, I found it empty.</p>
  
  <p>Where I am wrong?</p>
  
  <p><strong>Edit1</strong></p>
  
  <p>When I changed the insertStatement to </p>
  
  <pre><code>insertStatement = "INSERT INTO UserDetail(UserName, Password) Values('" + txtUserName.Text.Trim() + "','" + txtPassword.Text.Trim() + "')"
  </code></pre>
  
  <p>Than also nothing is updated into the database. and execute non query returned <em>1</em> to me. </p>
  
  <p>On keeping debugger on the insertStatement, I am getting the below Statement</p>
  
  <pre><code>INSERT INTO UserDetail(UserName, Password) Values('testName','TestPassword')
  </code></pre>