我使用下面的代码创建了一个 dbf 文件并填充它,一切正常。问题是文件名被截断为最多 8 个字符。知道为什么或如何保持全名吗?
string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+path+";Extended Properties=dBase IV";
OleDbConnection connection = new OleDbConnection(connectionString);
connection.Open();
cmd.CommandText = @"CREATE TABLE calendfull(
date1 datetime ,
day1 int ,
month1 int ,
year1 int ,
dow int ,
endmonth int
)";
cmd.ExecuteNonQuery();
foreach (DataRow row in calend.Rows)
{
day = Convert.ToInt32(row["day"]);
year = Convert.ToInt32(row["year"]);
month = Convert.ToInt32(row["month"]);
dow = Convert.ToInt32(row["dow"]);
endmonth = Convert.ToInt32(row["endmonth"]);
date1 = Convert.ToDateTime(row["date1"]);
cmd.CommandText = @"insert into calendFull values ('" + date1 + "'," + day + "," + month + "," + year + "," + dow + "," + endmonth + ")";
cmd.ExecuteNonQuery();
}