将记录从C#代码插入到foxpro dbf [英] Insert records to foxpro dbf from C# code

查看:128
本文介绍了将记录从C#代码插入到foxpro dbf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下代码将记录插入到foxpro dbf中.但是它引发了一个异常命令包含无法识别的短语/关键字".我该如何解决.

I used following code to insert record to foxpro dbf. But it throws an exception "Command contains unrecognized phrase/keyword." How can I fixed this.

string strLogConnectionString = @"Provider=vfpoledb;Data Source=E:\DBF\fLog.dbf;Collating Sequence=machine;Mode=ReadWrite;";

OleDbConnection strConLog = new OleDbConnection(strLogConnectionString);
strConLog.Open();

OleDbCommand oComm = new OleDbCommand("Insert into flog(File,Status,LogTime) values(''"+strFiles+"'',''"+strDesc+"'',''"+dDatetime+"'')", strConLog);

oComm.ExecuteNonQuery();

推荐答案

我认为您已经从
I think you already got many answers from HERE[^].


表字符串中的所有字段都是吗? dDateTime是字符串吗?
只是一个问题.

干杯
Are all the fields in your table strings? Is dDateTime a string?
Just a question.

Cheers


在这里给男人加油......:cool:

信息:各种FoxPro版本中的空白行为限制不同 [
Got it man here......:cool:

INFO: DELIMITED WITH BLANK Behavior Differs in Various FoxPro Versions[^]


这篇关于将记录从C#代码插入到foxpro dbf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆