for (int i = 0; i < dataGridViewX1.Rows.Count; i++)
{
strSQL = "Insert INTO input(name,value,vahed,date,projeh,factor,part,cos t,costall)values(" +
"@nm,@val,@vh,@dt,@prj,@fc,@prt,@cst,@cstall)" ;
con.Open();
com = new SqlCommand(strSQL, con);
com.Parameters.Add("@nm", SqlDbType.Char).Value = dataGridViewX1.Rows[i].Cells[3].Value;
com.Parameters.Add("@val", SqlDbType.Float).Value = dataGridViewX1.Rows[i].Cells[2].Value;
com.Parameters.Add("@vh", SqlDbType.Char).Value = dataGridViewX1.Rows[i].Cells[1].Value;
com.Parameters.Add("@dt", SqlDbType.Char).Value = strdate;
com.Parameters.Add("@prj", SqlDbType.Char).Value = dataGridViewX1.Rows[i].Cells[0].Value;
com.Parameters.Add("@fc", SqlDbType.Int).Value = textBox3.Text;
com.Parameters.Add("@prt", SqlDbType.Char).Value = dataGridViewX1.Rows[i].Cells[4].Value;
com.Parameters.Add("@cst", SqlDbType.Char).Value = dataGridViewX1.Rows[i].Cells[5].Value;
com.Parameters.Add("@cstall", SqlDbType.Char).Value = dataGridViewX1.Rows[i].Cells[6].Value;
com.ExecuteNonQuery();
con.Close();
}