【发布时间】:2015-10-21 05:59:19
【问题描述】:
我尝试使用以下代码将分隔文本附加到 Fox 表中:
OleDbConnection oledbConn = new OleDbConnection(String.Format(@"Provider=VFPOLEDB.1;Data Source={0};Collating Sequence=MACHINE", Inputpath + "UnRepWor.dbf"));
OleDbCommand oledbComm = new OleDbCommand { Connection = oledbConn, CommandType = CommandType.Text };
string insertCammand = String.Format(@"APPEND FROM {0} DELIMITED WITH TAB", @"'d:\TestServiceOutput\data.dat'");
oledbComm.CommandText = insertCammand.Trim();
try
{
oledbConn.Open();
oledbComm.ExecuteNonQuery();
}
catch (Exception ex)
{
throw Utility.GetExceptionDetails(ex, "WordRootFoxExportServiceDataAccessLayer - ImportToFoxTable- insert into Fox Table",ex.Message);
}
并得到这个错误:
Message = "One or more errors occurred during processing of command."
Source = "Microsoft OLE DB Provider for Visual FoxPro"
ErrorCode = -2147217900
ex.StackTrace :
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr)
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
【问题讨论】:
标签: c# visual-foxpro