title: Save blank data in database using material design form using c#
body: <p>I've used material design form in html and I set <code>EnableEventValidation=false</code> after click <code>save</code> button to save data in sql server, however there is a blank data saved in sql server </p>
  
  <pre><code>&lt;div class="form"&gt;
      &lt;h1&gt;Patient Information&lt;/h1&gt;
  
      &lt;div class="form-group"&gt;
          &lt;input type="text" runat="server" id="Fname" required="required" /&gt;
          &lt;label for="input" class="control-label"&gt;First Name&lt;/label&gt;&lt;i class="bar"&gt;&lt;/i&gt;
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
          &lt;input type="text" runat="server" id="Lname" required="required" /&gt;
          &lt;label for="input" class="control-label"&gt;Last Name&lt;/label&gt;&lt;i class="bar"&gt;&lt;/i&gt;
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
          &lt;input type="text" runat="server" id="Address" required="required" /&gt;
          &lt;label for="input" class="control-label"&gt;Address&lt;/label&gt;&lt;i class="bar"&gt;&lt;/i&gt;
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
          &lt;input type="text" runat="server" id="city" required="required" /&gt;
          &lt;label for="input" class="control-label"&gt;City&lt;/label&gt;&lt;i class="bar"&gt;&lt;/i&gt;
      &lt;/div&gt;
  
      &lt;div class="form-group"&gt;
          &lt;select runat="server" id="gender"&gt;
              &lt;option&gt;Male&lt;/option&gt;
              &lt;option&gt;Female&lt;/option&gt;
          &lt;/select&gt;
          &lt;label for="select" class="control-label"&gt;Gender&lt;/label&gt;&lt;i class="bar"&gt;&lt;/i&gt;
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
          &lt;label class="label-input100" for="date"&gt;Date Of Birth&lt;/label&gt;
          &lt;input type="date" id="birth" runat="server" name="datePurchase" /&gt;
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
          &lt;input type="text" runat="server" id="ssec" required="required" /&gt;
          &lt;label for="input" class="control-label"&gt;Social Security&lt;/label&gt;&lt;i class="bar"&gt;&lt;/i&gt;
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
          &lt;select runat="server" id="inppSel"&gt;
          &lt;/select&gt;
          &lt;input runat="server" type="hidden" style="color: red;" id="inpTxt" /&gt;
          &lt;label for="select" class="control-label"&gt;Patient Case&lt;/label&gt;&lt;i class="bar"&gt;&lt;/i&gt;
      &lt;/div&gt;
      &lt;div class="button-container"&gt;
          &lt;button onserverclick="save" type="submit" class="button" id="addnew" runat="server"&gt;&lt;span&gt;Submit&lt;/span&gt;&lt;/button&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>C#:</p>
  
  <pre><code>DataBaseConnection db = new DataBaseConnection();
  db.disconnect();
  
  string sql1 = "INSERT INTO TBL_Persons VALUES( @First_Name, @Last_Name, @Address, @City)";
  
  SqlCommand cmd1 = new SqlCommand(sql1, db.connect());
  cmd1.Parameters.AddWithValue("@First_Name", Fname.Value);
  cmd1.Parameters.AddWithValue("@Last_Name", Lname.Value);
  cmd1.Parameters.AddWithValue("@Address", Address.Value);
  cmd1.Parameters.AddWithValue("@City", city.Value);
  
  cmd1.ExecuteNonQuery();
  
  string sql2 = "INSERT INTO TBL_Patients VALUES(@Gender, @Date_OF_Birth, @Social_Security, @Person_ID, @Case_ID)";
  db.disconnect();
  
  string sql3 = "SELECT MAX(Person_ID) FROM TBL_Persons ";
  
  SqlCommand cmd2 = new SqlCommand(sql3, db.connect());
  int max = (int)(cmd2.ExecuteScalar());
  db.disconnect();
  
  SqlCommand cmd3 = new SqlCommand(sql2, db.connect());
  cmd3.Parameters.AddWithValue("@Gender", gender.Items[gender.SelectedIndex].Text);
  cmd3.Parameters.AddWithValue("@Date_OF_Birth", birth.Value);
  cmd3.Parameters.AddWithValue("@Social_Security", ssec.Value);
  cmd3.Parameters.AddWithValue("@Person_ID", max);
  cmd3.Parameters.AddWithValue("@Case_ID", inpTxt.Value);
  
  cmd3.ExecuteNonQuery();
  </code></pre>