摘要:
转载自:http://blog.csdn.net/missysm586/article/details/6644319C#code方法一.objectsumObject=DataTable.Compute("sum(Qty)","TRUE");直接对数据表中的字段求和,其中Qty的类型为Int整型方法二.doubleColumnSum(DataTabledt,stringColumnName){doubled=0;foreach(DataRowrowindt.Rows){d+=double.Parse(row[ColumnName].ToString()
阅读全文
posted @ 2013-01-21 01:20
无尤
阅读(17383)
推荐(0)
编辑
摘要:
//今天研究了DataGridView显示数据库中数据的方法,小结如下,有错望指正。谢谢!// 声明 DataSetDataSet set = new DataSet();string sqlstr = "Select *from bill "; OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source = DB.mdb;"); OleDbDataAdapter adapter = new OleDbDataAdapter(sqlst..
阅读全文
posted @ 2013-01-21 01:05
无尤
阅读(1761)
推荐(0)
编辑