c# vs2005 如何读取dbf文件,使用oledb方式 string selectCommand = "select * from base.dbf";from后面跟表名 不是 base.dbf 文件名DataSource 那里跟文件名 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 本人从事C#开发已有三年时间,希望结交行内好友,大家共同进取,请加我的QQ群号码:35651007 注明CSDN即可 可以用odbc直接調用呀;用ODBC直接調用string fileName=this.openFileDialog1.FileName;string filePath=fileName.Substring(0,fileName.LastIndexOf("\\"));string tableName=fileName.Substring(fileName.LastIndexOf("\\")+1);tableName=tableName.Substring(0,tableName.LastIndexOf("."));string connString="Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=" + filePath + ";Exclusive=No;";DataTable dt=new DataTable("dayAttend");OdbcConnection odbcConnection=new OdbcConnection(connString);OdbcDataAdapter OdbcDataAdapter=new OdbcDataAdapter("select * from "+tableName,odbcConnection);OdbcDataAdapter.Fill(dt); 缺少connection.Close();数据帮定不对bindingSource1.DataSource = customers.DefaultView; 求组c#怎么获取this[index]的值(Attribute?) vs 2005 dataSet 无法导入Execl表格 求谷歌地图标记用文字方式显示 方法! DropDownList 只有一条记录或第一个记录怎么没有OnSelectedIndexChanged 事件 有没有类似数据库创建表的控件? 求救 关于CheckedListBox 的问题 json解析 怎样为数据库写文档,欢迎讨论 为什么modbus调试精灵显示写通讯超时 2.0后又3.0,我靠 c/s客户端任何查看服务器上的图片
请加我的QQ群号码:35651007 注明CSDN即可
用ODBC直接調用
string fileName=this.openFileDialog1.FileName;
string filePath=fileName.Substring(0,fileName.LastIndexOf("\\"));
string tableName=fileName.Substring(fileName.LastIndexOf("\\")+1);
tableName=tableName.Substring(0,tableName.LastIndexOf("."));
string connString="Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=" + filePath + ";Exclusive=No;";
DataTable dt=new DataTable("dayAttend");
OdbcConnection odbcConnection=new OdbcConnection(connString);
OdbcDataAdapter OdbcDataAdapter=new OdbcDataAdapter("select * from "+tableName,odbcConnection);
OdbcDataAdapter.Fill(dt);
数据帮定不对
bindingSource1.DataSource = customers.DefaultView;