473,394 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Bulk Insert Problem

Attempting to use BULK INSERT to transfer data from a csv to a table in a dbo on an instance of sqlServer (MSDE). I’m very new at both sql server & vb.net. I keep getting an error
Unexpected End-Of-File (EOF) encountered in data fil
The destination table has been created just for this data & I believe I have typed all columns correctly
Does the error’s ‘data file’ refer to the csv or the table
Am I missing some Argument for the BULK statement
See code below. I have tried all arguments that are remarked (without luck)
My conceptual understanding of what is going on here is a bit foggy so as much explanation as you can afford is welcome
Private Sub btnBulk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBulk.Clic
Dim strCommandText As Strin
Dim cmdBlkIn As New System.Data.SqlClient.SqlComman
strCommandText = "BULK INSERT dbDailyEarnings.dbo.[table1a] FROM 'C:\Documents and Settings\Steve\Desktop\Test1a1.csv'
'strCommandText &= "WITH
'strCommandText &= "(
'strCommandText &= "DATAFILETYPE = 'native',
'strCommandText &= "FIELDTERMINATOR = '\c',
'strCommandText &= "ROWTERMINATOR = '\n'
'strCommandText &= "CODEPAGE = 'RAW'
'strCommandText &= ")
cmdBlkIn.CommandType = CommandType.Tex
cmdBlkIn.Connection = connSQ
cmdBlkIn.CommandText = strCommandTex
Tr
connSQL.Open(
cmdBlkIn.ExecuteNonQuery(
connSQL.Close(
Catch ex As Exceptio
Dim strmsg As Strin
strmsg = ex.ToStrin
MessageBox.Show(strmsg
End Tr
_______________________
Thank you to all of you who spend the time to assist the less experience
Steve
Nov 20 '05 #1
1 3330
Cor
Hi Steve,

This is really a question for the newsgroup

news://msnews.microsoft.com/microsof...amework.adonet

Although this was an answer on a almost the same question yesterday in this
newsgroup fom Bill Vaughn. (But not so detailed as yours, so you can give it
a try).

Do not use ADO.NET for bulk operations--it's not designed to do this.
Use BCP or DTS--it IS designed to move bulk data into and out of databases.

I hope this helps?

Cor

Nov 20 '05 #2

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

Similar topics

5
by: me | last post by:
I'm also having problems getting the bulk insert to work. I don't know anything about it except what I've gleened from BOL but I'm not seeming to get anywhere...Hopefully there is some little (or...
7
by: iqbal | last post by:
Hi all, We have an application through which we are bulk inserting rows into a view. The definition of the view is such that it selects columns from a table on a remote server. I have added the...
16
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums...
1
by: Metal Dave | last post by:
I do not understand the error handling of SQL Server here. Any error in bulk insert seems to halt the current T-SQL statement entirely, rendering it impossible to log an error. The first statement...
11
by: Ted | last post by:
OK, I tried this: USE Alert_db; BULK INSERT funds FROM 'C:\\data\\myData.dat' WITH (FIELDTERMINATOR='\t', KEEPNULLS, ROWTERMINATOR='\r\n');
2
by: Ted | last post by:
I have BULK INSERT T-SQL statements that work for all of my basic data tables except for one. Here is the problem statement (with obvious replacement of irrelevant path info): BULK INSERT...
3
by: Tim Satterwhite | last post by:
Hi All, I think this is a thorny problem, and I'm hoping you can help. I've not found this exact issue described anywhere yet. I have a stored procedure that calls BULK INSERT on a set of...
0
by: rshivaraman | last post by:
BULK INSERT bill_tbl FROM 'd:\ftp_Data\in\baddress.dat' WITH ( FIELDTERMINATOR = ';', ROWTERMINATOR = '\n' ) --------------------------------- This is the query used to populate bill_tbl....
0
by: bob laughland | last post by:
Hi All, I am using a combination of LINQ to SQL and bulk insert. In the process of performing 'one unit of work' I will be doing things like reading, and deleting records using LINQ to SQL and...
3
by: bob laughland | last post by:
Hi All, I am using a combination of LINQ to SQL and bulk insert. In the process of performing 'one unit of work' I will be doing things like reading, and deleting records using LINQ to SQL and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.