我有一个要执行查询的 dbf 文件。这是我的代码(.net 4.0,C# Windows 窗体):
oconn.ConnectionString = "Provider=vfpoledb.1;Data Source=" + path + ";Collating Sequence=machine";
oconn.Open();
OleDbCommand ocmd = oconn.CreateCommand();
string na = TBNazwaKonta.Text.Replace("\n","");
na = na.Replace("\r","") ;
string ks2 = ks.Replace("\n","");
ks2 = ks2.Replace("\r", "");
string zapytanie = @"insert into " + path + " (rk, Na,Ks,Ss,So,Wyr,Bw,Bm,Ow,Om,Wm,Mm,Pm,Pw,Ks1,Ks2,Ks3,Ks4,Llx,Wn01,Ma01,L01,Wn02,Ma02,L02,Wn03,Ma03,L03,Wn04,Ma04,L04,Wn05,Ma05,L05,Wn06,Ma06,L06,Wn07,Ma07,L07,Wn08,Ma08,L08,Wn09,Ma09,L09,Wn10,Ma10,L10,Wn11,Ma11,L11,Wn12,Ma12,L12) values (0,'Z-Dz PROD.OPAKOWAŃKIEWICZA 108 38-200 ', '200 02 000212',0,0,'',0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,'','','','',0,0.0,0.0,0,0.0,0.0,0,0.0,0.0,0,0.0,0.0,0,0.0,0.0,0,0.0,0.0,0,0.0,0.0,0,0.0,0.0,0,0.0,0.0,0,0.0,0.0,0,0.0,0.0,0,0.0,0.0,0)";
ocmd.CommandText = zapytanie;
ocmd.ExecuteNonQuery();
oconn.Close();
连接很好,插入查询也很好,但我想知道为什么这个 dbf 不接受空值。
我在哪里可以检查 dbf 是否接受空值?当我使用程序读取 dbfs 并执行查询时,dbf 接受 null。它仅在我使用 ado.net 时才接受。感谢您帮助解决我的问题