sql - Save UTF8 string by SqlBulkCopy c# -


I have this SQL query:

  include myTable (myField) values ​​( N 'Thermal Oxide: 0 à ?? to 40 μm')   

and I want to exeute by SqlBulkCopy like this:

  DataTable myDataTable = myDb .getData ("Select Top 1 * from MyTable"). Clone (); Datarov dr = myDataTable.NewRow (); Dr. ["MyField"] = "N 'Thermal Oxide: 0Ã ?? to 40¼¼' ''; myDataTable.Rows.Add (Dr.); this.openCon (); (SqlBulkCopy bulkCopy = New SqlBulkCopy (con)) Using {bulkCopy.DestinationTableName = dt.TableName; BulkCopy.BulkCopyTimeout = 100; bulkCopy.WriteToServer (myDataTable);} This.closeCon ();   

This job is correct, but mine The question is: Where can I add the 'N' prefix?

bus:

  dr ["myField"] = "Thermal oxide: 0 Ã ??    is required only for  liters  in TSQL; but when you  data  (not TSQL), then you do not have to worry about it. In the case of  SqlBulkCopy , it will go down on the server in a raw format, not directly as TSQL .  

In the more general case of the adapter or ORM, the library will either use the (most likely) parameter, or it will avoid itself It will also be concerned that adding 1 line through SqlBulkCopy is overkill but it should work.

Comments