try
{
LblDinarKarton.Text =
(from DataGridViewRow row in dataGridView6.Rows
where Convert.ToDouble( row.Cells[10].FormattedValue.ToString().Replace(",","")) != 0
select (Convert.ToDouble(row.Cells[10].FormattedValue.ToString().Replace(",", "")) * Convert.ToDouble(row.Cells[2].FormattedValue.ToString().Replace(",", ""))) + ((Convert.ToDouble(row.Cells[10].FormattedValue.ToString().Replace(",", "")) / Convert.ToDouble(row.Cells[3].FormattedValue.ToString().Replace(",", ""))) * (Convert.ToDouble(row.Cells[4].FormattedValue.ToString().Replace(",", ""))))).Sum().ToString();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
What I have tried:
try
{
LblDinarKarton.Text =
(from DataGridViewRow row in dataGridView6.Rows
where Convert.ToDouble( row.Cells[10].FormattedValue.ToString().Replace(",","")) != 0
select (Convert.ToDouble(row.Cells[10].FormattedValue.ToString().Replace(",", "")) * Convert.ToDouble(row.Cells[2].FormattedValue.ToString().Replace(",", ""))) + ((Convert.ToDouble(row.Cells[10].FormattedValue.ToString().Replace(",", "")) / Convert.ToDouble(row.Cells[3].FormattedValue.ToString().Replace(",", ""))) * (Convert.ToDouble(row.Cells[4].FormattedValue.ToString().Replace(",", ""))))).Sum().ToString();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}