Subhash Sharma

Subhash Sharma
Subhash Sharma

This is Subhash Sharma(Software Engineer) Blog

Welcome to this blog and find every solution.............

Search This Blog

Software Engineer(Subhash Sharma)

Software Engineer(Subhash Sharma)
Software Engineer

Tuesday, January 11, 2011

Compute with DataTable

DataTable Dtable=new DataTable();
DataColumn DColumn=new DataColumn("Salary",typeof(float));
DTable.Column.Add(DColumn);

DataRow DRow=DTable.NewRow();
DRow[0]=25000;
DTable.Rows.Add(DRow);

DRow=DTable.NewRow();
DRow[0]=30000;
DTable.Rows.Add(DRow);

float TotalSalary=(float)DTable.Compute("Sum(Salary)","");
Console.WriteLine(TotalSalary);

No comments:

Post a Comment