我有这个 Sql 查询:
INSERT INTO myTable (myField) VALUES (N'Thermal Oxide: 0 Å to 40 μm')
我想通过 SqlBulkCopy 像这样执行它:
DataTable myDataTable=myDb.getData("select top 1* from myTable").Clone();
DataRow dr = myDataTable.NewRow();
dr["myField"] ="N'Thermal Oxide: 0 Å to 40μm'";
myDataTable.Rows.Add(dr);
this.openCon();
using (SqlBulkCopy bulkCopy = new SqlBulkCopy(con)) {
bulkCopy.DestinationTableName = dt.TableName;
bulkCopy.BulkCopyTimeout = 100;
bulkCopy.WriteToServer(myDataTable);
} this.closeCon();
它工作完美,但我的问题是:我在哪里可以初始化“N”前缀?也许没有必要?
谢谢,陈