title: ID inserted using ASP Web APi appearing as empty in MySql? c#
body: <p>I have create a Rest web api using ASP.net. When I insert new data using the api, the ID appearing as empty in Mysql workbench. Other columns apart of ID can get the data I'm inserting. When I try to insert new data, it gives me exception Duplicate entry '' for Primary key.</p>
  
  <p>Insert code in DBconn.cs</p>
  
  <pre><code>public void addMeterReading(string id, string machinemeterreadingid, int reading)
      {
          MySqlConnection myconn = getDBConn();
          String sqlstr = "INSERT INTO actualmeterreading (ID ,MachineMeterReadingId,ActualReading) VALUES ('" + id + "','" + machinemeterreadingid + "', "+reading+")";
          MySqlCommand cmd = new MySqlCommand(sqlstr, myconn);
          myconn.Open();
          cmd.ExecuteNonQuery();
          myconn.Close();
          myconn.Dispose();
  
      }
  </code></pre>
  
  <p>POST api code</p>
  
  <pre><code>[HttpPost]
      [Route ("api/ActualMeterReading/{id}/{machinemeterid}/{reading}")]
      public void Post([FromBody]string id, string machinemeterid, int reading)
      {
          DBConn db = new DBConn();
          db.addMeterReading(id, machinemeterid, reading);
      }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/T99Cj.jpg" rel="nofollow noreferrer">Data entering and output in MySql</a></p>
  
  <p><a href="https://i.stack.imgur.com/gtm6u.jpg" rel="nofollow noreferrer">Table defination</a></p>