我有这张桌子:
Items
====
Barcode (text)
Des (text)
Price (double)
我制作了 csv 文件d:\Items.csv
以便快速插入 (12345,computer,120.44).....
我尝试像这样插入(C# WinForm 程序):
Cmd = Conn.CreateCommand();
SQL = @"INSERT INTO Items SELECT * FROM [Text;DATABASE=" + @"d:" + @"\].[Items.txt];";
Cmd.CommandText = SQL;
Cmd.ExecuteNonQuery();
但我有 2 个错误:
1. Data type mismatch in criteria expression.
2. The field 'Items.Barcode ' cannot contain a Null value because the Required property for this field is set to True. Enter a value in this field.
如何解决这个问题?