try like this
SqlConnection con = new SqlConnection();
con.Open();
SqlCommand cmd = new SqlCommand("insert into tbl_car (name) values (@name); select scope_identity()", con);
cmd.Parameters.AddWithValue("@name", txt_name.Text);
cmd.Connection = con;
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
int id = Convert.ToInt32(dt.Rows[0][0]);
cmd.ExecuteNonQuery();
con.Close();
foreach (var file in uploader.PostedFiles)
{
int length = uploader.PostedFile.ContentLength;
byte[] pic = new byte[length];
uploader.PostedFile.InputStream.Read(pic, 0, length);
string filename = Path.GetFileName(uploader.PostedFile.FileName);
uploader.SaveAs(Server.MapPath("~/Insert/Img/" + filename));
string cs = ConfigurationManager.ConnectionStrings["theoneConnectionString"].ToString();
SqlConnection con = new SqlConnection(cs);
con.Open();
SqlCommand cmd1 = new SqlCommand("insert into tbl_img (imgpath,imgid) values (@imgpath,@id)", con);
cmd1.Parameters.AddWithValue("@imgpath", "~/Insert/Img/" + filename);
cmd1.Parameters.AddWithValue("@id", id);
cmd1.Connection = con;
cmd1.ExecuteNonQuery();
con.Close();
}