title: How to save integer to sql column with data type int
body: <p>i am having this problem for quite some time now and cannot figure out the solution..</p>
  
  <p>i have a productid that i get as a result of sql query. The data type of productid in database is int</p>
  
  <pre><code>        Dim scheduleid As Integer
  
          cmd.CommandText = "Insert into DeploymentSchedules (scheduleName) values('Schedule');select Scope_Identity();"
          scheduleid = cmd.ExecuteScalar()
  </code></pre>
  
  <p>Now when i want to insert it into another table ...</p>
  
  <pre><code>        cmd.CommandText = "Insert into 
    locationsSchedule(LocationName,length,width,height,floor,walls,permIeter,scheduleid)
    values('" + strRoomName + "','" + txtLength.Text + "','" + txtWidth.Text + "','" + 
    txtHeight.Text + "','" + wallSTring + "','" + floorString + "','" + perimeterStrin +
      "','" + scheduleid + "')"
          cmd.ExecuteScalar()
  </code></pre>
  
  <p>I am having error </p>
  
  <pre><code>       Conversion from string "Insert into locationsSchedule(Lo" to type 'Double'
         is not valid.
  </code></pre>
  
  <p>I know it has something to do with integer as when i remove product id it is working .Please help</p>
  
  <p>THank you</p>