473,581 Members | 2,497 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SqlBulkCopy problem

GB
Hello:
I am developing C# project, using ADO .NET 2.0 to connect to SQL Server
2005.
I created a DataTable from scratch, and then use SqlBulkCopy to insert it
into an empty table in a SQL Server 2005 table.
The datatable I created from scratch matches exactly the empty SQL Server
2005 table.

However, when this runs I get the error:

Exception {"OLE DB provider 'STREAM' for linked server '(null)' returned
invalid data for column '[!BulkInsert].MyField. "} System.Exceptio n
{System.Data.Sq lClient.SqlExce ption}

But for SQL Server 2000 everything is OK!

Could you please give me a hint how to fix the problem?

Thanks,
GB


Jun 22 '06 #1
1 4488

"GB" <v7****@hotmail .com> wrote in message
news:1yFmg.8206 2$771.14333@edt nps89...
Hello:
I am developing C# project, using ADO .NET 2.0 to connect to SQL Server
2005.
I created a DataTable from scratch, and then use SqlBulkCopy to insert it
into an empty table in a SQL Server 2005 table.
The datatable I created from scratch matches exactly the empty SQL Server
2005 table.

However, when this runs I get the error:

Exception {"OLE DB provider 'STREAM' for linked server '(null)'
returned
invalid data for column '[!BulkInsert].MyField. "} System.Exceptio n
{System.Data.Sq lClient.SqlExce ption}

But for SQL Server 2000 everything is OK!

Could you please give me a hint how to fix the problem?


Don't multipost. See response in sqlserver.progr amming.

David

Jun 23 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
4599
by: Oscar Thornell | last post by:
Hi, I am trying to enlist an instance of SqlBulkCopy into a transaction. When I executes and try to write to the database I´ll get an exception indicating a transactional deadlock. "Transaction (Process ID 58) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction." 1) Is...
0
1301
by: Cwappy | last post by:
I have a class that builds a DataTable and then, when the process is exiting, tries to write that DataTable to SQL Server 2000 via the SqlBulkCopy class. I know the process is exiting because I'm catching the ProcessExit event (this is a console app). The problem is that calling WriteToServer as seen below will immediately exit the program...
1
3622
by: harleedavidson | last post by:
Using SqlBulkCopy.WriteToServer to upload a datatable and getting: System.Data.SqlClient.SqlException Line 1: Incorrect syntax near 'COLLATE'. Database Server is SQL2000, database in in 6.5 compatibility mode. No error when targeting SQL2000 database in 8.0 compatibility mode. Is this specific to 6.5 and is there a workaround?
4
5489
by: Chris | last post by:
I have created a datatable from a csv file. One of the columns is an integer which sometimes can be blank. When it is blank I add a dbnull.value to the column when I add to the datatable. This doesn't throw an error but when I do my bulk insert I get a 'data input' error. When I replace the nulls with a value it works. What am I doing wrong....
5
14759
by: TheSteph | last post by:
Using : MS-SQL 2005 / .NET 2.0 / VS2005 I have two server with the same database def but different data. I would like to import data from Server2.TableA to Server1.TableA. If a row doesn't exists on Server1.TableA, it should be added; if the data already exists it should be updated. I have to write a C# application do this operation on...
1
7499
by: Dave | last post by:
I'm using the SqlBulkCopy object to bulk insert large DataTable's into SQL Server. Its working well except tables with IDENTITY columns in them. When calling SqlBulkCopy.WriteToServer(DataTable) - I hit the following error "The given value of type String from the data source cannot be converted to type bigint of the specified target...
2
2343
by: Amar | last post by:
Hi, I need to insert a large amount of records pretty frequently through my application. The quickest way to achive this seems to be SQLBulkcopy class. I have implemented the solution using the bulkcopy class and works quite well except for one problem. It doesn seem to release the memory it uses. I have found that the memory used increases...
1
3304
by: Sergey Zenyuk | last post by:
In VB.net windows application I use following code implementing SqlBulkCopy import: Using connODBC As New OdbcConnection(ConnStrODBC) connODBC.Open() Dim dbcmd As New OdbcCommand(String. Format("select * from {0}", TableName), connODBC) dbcmd.CommandTimeout = SQL_TIMEOUT bulkcopy.WriteToServer(dbcmd.ExecuteReader()) connODBC.Close()...
3
2306
by: SteveB | last post by:
Hi All, Using the SQLBulkCopy for big CSV files consumes almost all the memory in the computer. I found how to resolve this problem while google that, but no code was added. The person claimed that he flushed all temporary working tables every 100K records to avoid filling up the memory. If someone dealt with this please write down the...
0
7792
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8149
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8304
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
5674
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5364
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3805
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2301
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1403
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1138
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.