Click here to Skip to main content
15,888,286 members

Comments by michael nabil (Top 5 by date)

michael nabil 15-Apr-18 21:36pm View    
thank u very much it's work
michael nabil 12-Apr-18 14:11pm View    
I did as you said thank you
michael nabil 8-Apr-18 18:33pm View    
i make this code trying to do this column 3 calculate like that
400+150=550
150+600+150=900
150+600+300+200=1250
150+600+300+400+562.5=2012.5
but i found that my code only sum column what i wan't very simple in excel sheet but i can't do that in grideview
michael nabil 7-Apr-18 16:29pm View    
thanks for your help but
i used access 2007 and dotnet 2005
I appreciate your idea
michael nabil 7-Apr-18 16:25pm View    
i tried this code to make table in run time but i used var sum1 to accumulated column 1 but i didn't work

DataTable workTable = new DataTable("Customers");
DataColumn workCol = workTable.Columns.Add("id", typeof(Int32));
workCol.AllowDBNull = true;
workCol.Unique = false;

DataRow workRow;
workTable.Columns.Add("Column 1", typeof(Double));
workTable.Columns.Add("Column 2", typeof(Double));
workRow = workTable.NewRow();

workRow[0] = Convert.ToInt32(dr[7].ToString());
workRow[1] = Convert.ToDouble(Column 1.ToString());
workRow[2] = Convert.ToDouble(Column 2.ToString());

workTable.Rows.Add(workRow);
int sum1 = 0;
int sum2 = 0;
foreach (DataRow dr1 in workRow.Table.Rows)
{

sum1 += Convert.ToInt32(dr1["Column 1"]);
sum2 += Convert.ToInt32(dr1["Column 2"]);

sum1.ToString();
sum2.ToString();
}