Bug 18801 - SqlBulkCopy doesn't work at all.
Summary: SqlBulkCopy doesn't work at all.
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Data (show other bugs)
Version: 3.2.x
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-04-03 14:04 UTC by Don Clore
Modified: 2017-09-01 09:29 UTC (History)
1 user (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
A minimal C# console app that creates a datatable with one row added, opens a connection to Sql Server, creates a SqlBulkCopy object, and attempts to bulk copy to the server. (2.44 KB, text/x-csharp)
2014-04-03 14:04 UTC, Don Clore
Details

Description Don Clore 2014-04-03 14:04:48 UTC
Created attachment 6489 [details]
A minimal C# console app that creates a datatable with one row added, opens a connection to Sql Server, creates a SqlBulkCopy object, and attempts to bulk copy to the server.

As near as I can determine, System.Data.SqlClient.SqlBulkCopy doesn't work at all on Mono.   I'm attaching as minimal an example as I could contrive; sadly, by the nature of this problem, you have to stand up a Sql Server to reproduce this.  I included a snippet of T-Sql to create the table to attempt the bulkCopy into, and a sample connection string with secrets and database names removed so hopefully this can be fairly easily reproduced.

This sample works on .NET, all versions.   

My stack looks liks:

Bulk Copy failed, error = Incorrect syntax near ','., stack =   at System.Data.SqlClient.SqlConnection.ErrorHandler (System.Object sender, Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs e) [0x00032] in /usr/src/packages/BUILD/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs:318 
  at Mono.Data.Tds.Protocol.Tds.OnTdsErrorMessage (Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs e) [0x0000b] in /usr/src/packages/BUILD/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs:1719 
  at Mono.Data.Tds.Protocol.Tds.ProcessMessage (TdsPacketSubType subType) [0x000ef] in /usr/src/packages/BUILD/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs:1759 
  at Mono.Data.Tds.Protocol.Tds.ProcessSubPacket () [0x0012a] in /usr/src/packages/BUILD/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs:1811 
  at Mono.Data.Tds.Protocol.Tds.NextResult () [0x0004a] in /usr/src/packages/BUILD/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs:641 
  at Mono.Data.Tds.Protocol.Tds.SkipToEnd () [0x00005] in /usr/src/packages/BUILD/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs:714 
  at Mono.Data.Tds.Protocol.Tds.ExecBulkCopyMetaData (Int32 timeout, Boolean wantResults) [0x0001f] in /usr/src/packages/BUILD/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs:558 
  at Mono.Data.Tds.Protocol.TdsBulkCopy.SendColumnMetaData (System.String colMetaData) [0x00022] in /usr/src/packages/BUILD/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsBulkCopy.cs:54 
  at System.Data.SqlClient.SqlBulkCopy.BulkCopyToServer (System.Data.DataTable table, DataRowState state) [0x00246] in /usr/src/packages/BUILD/mcs/class/System.Data/System.Data.SqlClient/SqlBulkCopy.cs:415 
  at System.Data.SqlClient.SqlBulkCopy.WriteToServer (System.Data.DataTable table) [0x00000] in /usr/src/packages/BUILD/mcs/class/System.Data/System.Data.SqlClient/SqlBulkCopy.cs:531 
  at bc.bc.DoBulkCopy (System.Data.DataTable dataTable) [0x0002b] in /media/doncl/NTFS_DDRIVE/workspaces/bc/bc.cs:42

Note You need to log in before you can comment on or make changes to this bug.