OleDbConnection connection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=C:\Documents and Settings\Administrator\桌面\班费管理模块\feemanage.mdb");
connection.Open();
OleDbDataAdapter adapter = new OleDbDataAdapter("SELECT * FROM feemanage",connection);
OleDbCommandBuilder builder = new OleDbCommandBuilder(adapter);
DataSet dataset = new DataSet();
adapter.Fill(dataset,"feemanage");
foreach ( DataColumn adc in dataset.Tables["feemanage"].Columns);
Console.WriteLine( adc["income"]);
//dataset.Tables[" feemanage " ].Columns["expense" ] .Expression= "Sum(expense)";
connection.Close();
这段代码竟然错了,显示 :
C:\Documents and Settings\Administrator\桌面\ConsoleApplication1\Class1.cs(30): 名称“adc”在类或命名空间“DataUpdateApp.DataUpdate”中不存在
前面已经有using System;
using System.Data;
using System.Data.OleDb;
还有我想的到一列 然后求出sum
//dataset.Tables[" feemanage " ].Columns["expense" ] .Expression= "Sum(expense)";
也错了 不知道怎么求??请帮帮我呀??
或给一些 代码提示一下了