惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

宝玉的分享
宝玉的分享
NISL@THU
NISL@THU
E
Exploit-DB.com RSS Feed
L
LINUX DO - 热门话题
L
Lohrmann on Cybersecurity
K
Kaspersky official blog
Project Zero
Project Zero
Cisco Talos Blog
Cisco Talos Blog
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threatpost
S
Schneier on Security
G
GRAHAM CLULEY
The Hacker News
The Hacker News
T
Threat Research - Cisco Blogs
Scott Helme
Scott Helme
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Privacy & Cybersecurity Law Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
T
Tor Project blog
AWS News Blog
AWS News Blog
Simon Willison's Weblog
Simon Willison's Weblog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
爱范儿
爱范儿
P
Privacy International News Feed
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
S
Securelist
G
Google Developers Blog
The Last Watchdog
The Last Watchdog
Google Online Security Blog
Google Online Security Blog
美团技术团队
F
Fortinet All Blogs
小众软件
小众软件
Recorded Future
Recorded Future
V
Visual Studio Blog
B
Blog RSS Feed
H
Help Net Security
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Google DeepMind News
Google DeepMind News
Blog — PlanetScale
Blog — PlanetScale
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
Martin Fowler
Martin Fowler
Latest news
Latest news
Spread Privacy
Spread Privacy
H
Heimdal Security Blog

博客园 - ZH.net

在vb.net中通过ODBC从Oracle 9i向Access倒数据 从SQLSERVER向ORACLE8迁移的技术实现方案 Part V [转] 从SQLSERVER向ORACLE8迁移的技术实现方案 PartIV [转] 从SQLSERVER向ORACLE8迁移的技术实现方案 PartIII [转] 从SQL SERVER向ORACLE的迁移方案[转] PartII Sql Server 转入 Oracle part I (转自网络) 在 .NET 中使用 Oracle 数据库事务 作者:Jason Price 转自oracle.com Oracle Trigger(转自网络) Oracle的分页以及sequence 一些正则表达式 - ZH.net - 博客园 接昨日,将上传至oracle的excel文件下载下来 将文件(word,excel等)存入oracle的一个字段 Web利用Gloabl.asax实现多线程任务 maintain AD(将一个账号移动到另一个群组) 一個Check AD的类。from MSDN 一些JS ViewState的一些学习笔记 发mail时smtp服务器设置的一个问题 datagrid前加checkbox
.net studio 2005操作dbf文件
ZH.net · 2006-02-21 · via 博客园 - ZH.net

有两个途径
一个是用odbc。。我试验了很久没有成功,不过也把步骤发出来大家参考。
用odbc先要安装odbc_net这个文件,安装之后在默认文件夹)里有个microsoft.data.odbc.dll把这个加入到专案里。
然后
using microsoft.data.odbc

  string sConnectionString;    
sConnectionString = "Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=C:\\DOC\\PCS\\DBF\\invoice.dbf;Exclusive=No;NULL=NO;Collate=Machine;BACKGROUNDFETCH=NO;DELETED=NO";

    string sql = "select * from invoice.dbf";
       OdbcConnection cnn = new OdbcConnection(sConnectionString);
        
       cnn.Open();
       OdbcCommand cmd = new OdbcCommand(sql, cnn);
       string sts;
       OdbcDataReader  dr = cmd.ExecuteReader();
        while (dr.Read())
       {
           sts = dr[0].ToString();           
       }
       dr.Close();

但是我每次跑到cnn.open就不行了。抱错信息:ERROR [IM001] [Microsoft][ODBC Driver Manager] Driver does not support this function
我查了一下说是一个VFPODBC.DLL文件不够新需要新下。。网上的最新版本是6.1.86291我没下到,我下到一个比较新的版本但是没法用。所以就放弃了odbc的尝试。
第二个就是用oledb。这个比较简单。我是在csdb上发帖求助之后开始尝试这个的。
using System.Data.OleDb;

  OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=dBASE 5.0;Password=;User ID=;Data Source=C:\\DOC\\PCS\\DBF\\");
     conn.Open();
     OleDbCommand cmd = new OleDbCommand();
     cmd.CommandText = "select * from invoice.dbf";
     cmd.Connection = conn;
     OleDbDataReader reader = cmd.ExecuteReader();
     string sts;
     while (reader.Read())
     {
         sts = reader[0].ToString();
     }
     reader.Close();
//查询,下面是插入
string sql = "insert into invoice.dbf (INVNO,INVDATE,INVAMT,PAYDATE,WORKNO,SMRNO,CONTCODE,WORKCOMP) VALUES('123456','02-04-2006','100.0','02-04-2006','32145','232','12','02-04-2006')";
     cmd.CommandText = sql;
     cmd.Connection = conn;
     cmd.ExecuteNonQuery();