zzzprojects / Bulk-Operations

C# SQL Bulk Operations | High-performance C# bulk insert, update, delete and merge for SQL Server, SQL Azure, SQL Compact, MySQL, and SQLite.
https://bulk-operations.net
142 stars 36 forks source link

BulkUpdate is not updating #52

Closed lesianocmn closed 5 years ago

lesianocmn commented 5 years ago

Hello, I'm trying to update some values and it's not working. I'm trying to do like the I saw in the examples.. but any value is updated. I'm using SQL Server. What I'm doing wrong? Thanks.

using (var connection = new SqlConnection(connectionString))
                {
                    connection.Open();
                    using (var bulk = new BulkOperation<MyBussines>(connection))
                    {

                        bulk.DestinationTableName = "MyBussines";
                        bulk.ColumnMappings.Add("MyBussinesId", "MyBussinesID", true);
                        bulk.ColumnMappings.Add("MyBussinesNameId", "MyBussinesNameID", false);
                        bulk.ColumnMappings.Add("MyBussinesSavedByUserId", "MyBussinesSavedByUserID", false);
                        bulk.BulkUpdate(values);
                    }
                }
JonathanMagnan commented 5 years ago

Hello @lesianocmn ,

Do you think you could provide us a runnable project with only this example that shows the issue?

Everything looks good in your code so perhaps we are missing something important to reproduce it.

Best Regards,

Jonathan