.net ODBC驱动程序生成8,3.DBF文件

8iwquhpp  于 2023-05-19  发布在  .NET
关注(0)|答案(1)|浏览(138)

我开发了一个程序在c#。net,我需要生成一个。dbf文件,它的工作在我的电脑上时,即时通讯建设的应用程序与visual studio。但如果我编译到服务器它的生成8,3个文件,这意味着文件名是8个字符,但我需要更多。ODBC驱动程序相同。我能做什么?

using (var dBaseConnection = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + DBFPath + ";Extended Properties=dBASE III;"))
            {
                dBaseConnection.Open();
                string str0 = @" Create Table " + FileNameBase + FileNameSuffix + " (NKAZON char(244), ADOSZAM char(244), DATUM char(244), GYNEV char(244), TTT char(244), TKSZAM char(244), KSZ char(244), NYITO char(244), BESZ char(244) );";
                var cmd2 = new OleDbCommand(str0, dBaseConnection);
                cmd2.ExecuteNonQuery();
                foreach (var item in ExportDBF)
                {
                    string str1 = @" INSERT INTO " + FileNameBase + FileNameSuffix + " (NKAZON, ADOSZAM, DATUM, GYNEV, TTT, TKSZAM, KSZ, NYITO, BESZ) VALUES(" + "'" + item.NKAZON + "'," + "'" + item.ADOSZAM + "'," + "'" + item.DATUM.ToString("yyyyMM") + "'," + "'" + item.GYNEV + "'," + "'" + item.TTT + "'," + "'" + item.TKSZAM + "'," + "'" + item.KSZ + "'," + "'" + item.BESZ + "'," + "'" + item.NYITO + "');";
                    var cmd = new OleDbCommand(str1, dBaseConnection);
                    cmd.ExecuteNonQuery();
                }

            }
iklwldmw

iklwldmw1#

好的,我解决了这个问题,我需要安装office 365并在服务器中运行access一次。

相关问题