public EmployeeManage(){InitializeComponent(); this.connectionStr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +Application.StartupPath + "\\ManPowerManage.mdb"; this.selectStr="select * from Employee";this.Connection1=new OleDbConnection(this.connectionStr);this.Command1=new OleDbCommand();this.dataAdapter1=new OleDbDataAdapter(this.selectStr,this.Connection1);this.selectStr="select * from Dimmision";this.dataAdapter2=new OleDbDataAdapter(this.selectStr,this.Connection1);this.Command1.Connection=this.Connection1;this.Command1.CommandText=this.commandStr;}
1 回答
莫回无
TA贡献1865条经验 获得超7个赞
一段用ole方式连接excel数据库文件的代码,数据库在应用程序的当前目录下。
从数据库的表Employee读出员工信息,并且能用“Command1”操作数据库
添加回答
举报
0/150
提交
取消