title: IDK whats wrong. It says input string is not in correct format
body: <p>Im using a detailsview control to show the details of the car from the row selected in gridview. It gets to the edit option but on clicking the update link it gives this error
  Can any one help? Thanks in advance</p>
  
  <pre><code>protected void DetailsView1_ItemUpdating1(object sender, DetailsViewUpdateEventArgs e)
      {
          var conString = ConfigurationManager.ConnectionStrings["CONSTRING"].ConnectionString;
          SqlConnection con = new SqlConnection(conString);
          int idd = Convert.ToInt32(DetailsView1.Rows[0].Cells[1].Text);
          TextBox gt = DetailsView1.Rows[1].Cells[1].Controls[0] as ?TextBox;
          TextBox ma = DetailsView1.Rows[2].Cells[1].Controls[0] as TextBox;
          TextBox mo = DetailsView1.Rows[2].Cells[1].Controls[0] as TextBox;
          TextBox eng = DetailsView1.Rows[2].Cells[1].Controls[0] as TextBox;
          TextBox cn = DetailsView1.Rows[2].Cells[1].Controls[0] as TextBox;
          TextBox vin = DetailsView1.Rows[2].Cells[1].Controls[0] as TextBox;
          TextBox am = DetailsView1.Rows[2].Cells[1].Controls[0] as TextBox;
          TextBox cond = DetailsView1.Rows[2].Cells[1].Controls[0] as TextBox;
          TextBox var = DetailsView1.Rows[2].Cells[1].Controls[0] as TextBox;
          TextBox col = DetailsView1.Rows[2].Cells[1].Controls[0] as TextBox;
          TextBox carnum = DetailsView1.Rows[2].Cells[1].Controls[0] as TextBox;
  
          SqlDataAdapter SQLAdapter = new SqlDataAdapter("update cars set geartype = '"+gt.Text+ "', make ='" +ma.Text + "',  model ='" + mo.Text + "', engnum ='" + eng.Text + "', chasisnum ='" + cn.Text + "', vin ='" + vin.Text + "', amount ='" + am.Text + "', Condition ='" + cond.Text + "', variant ='" + var.Text + "', color ='" + col.Text + "', carnum ='" + carnum.Text + "' where carid="+idd+"", con);
          DataTable DT = new DataTable();
          SQLAdapter.Fill(DT);
  
          DetailsView1.ChangeMode(DetailsViewMode.ReadOnly);
          DetailsView1.DataBind();
      }
  </code></pre>