PC Review


Reply
Thread Tools Rate Thread

DBNull with SQLBulkCopy

 
 
dwelzel
Guest
Posts: n/a
 
      18th Dec 2006
While using SqlBulkCopy to load data into a SQL Server 2005 database,
I've noticed an occasional exception that is saying one of the fields
in my DataTable object contains a null value and this is failing the
not null constraint on the table.

When I set up the DataTable object prior to the bulk insert I simply
set this field to an integer value, so it is never null in my code.
I've even put in some validation code on the DataTable object that runs
prior to the bulk insert and everything looks like.

This is a sporadic error and I've seen a few others that are similar so
it worries me that the objects are getting (slightly) corrupted between
the time I build them and when the bulk insert actually happens.

Has anyone seen something similar to this?

Thanks!

 
Reply With Quote
 
 
 
 
chanmm
Guest
Posts: n/a
 
      20th Dec 2006
You mention you set up DataTable and so then where is the code?

chanmm

"dwelzel" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> While using SqlBulkCopy to load data into a SQL Server 2005 database,
> I've noticed an occasional exception that is saying one of the fields
> in my DataTable object contains a null value and this is failing the
> not null constraint on the table.
>
> When I set up the DataTable object prior to the bulk insert I simply
> set this field to an integer value, so it is never null in my code.
> I've even put in some validation code on the DataTable object that runs
> prior to the bulk insert and everything looks like.
>
> This is a sporadic error and I've seen a few others that are similar so
> it worries me that the objects are getting (slightly) corrupted between
> the time I build them and when the bulk insert actually happens.
>
> Has anyone seen something similar to this?
>
> Thanks!
>


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sqlBulkCopy Tony Johansson Microsoft C# .NET 0 30th Sep 2010 08:50 AM
VBA: SQLBulkCopy Marc Seitz Microsoft ADO .NET 1 27th Oct 2008 05:21 PM
sqlBulkCopy Beth Microsoft ADO .NET 1 29th Feb 2008 10:45 PM
SqlBulkCopy =?Utf-8?B?Sml0ZW5kcmEga3VtYXI=?= Microsoft ADO .NET 1 28th Dec 2006 06:56 PM
SqlBulkCopy mUraliDharan Microsoft ADO .NET 1 20th Dec 2006 01:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:04 AM.