Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 10th, 2006, 05:02 PM
Authorized User
 
Join Date: Dec 2005
Location: San Nicolas, Buenos Aires, Argentina.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to arielote Send a message via MSN to arielote Send a message via Yahoo to arielote
Default Import a Comma separated txt file to SQL table

Hi fellows!

I need to read from disk a TXT file, comma separated, then to populate to SQL table.
By default I was thinking into use streamreader.readline(), parsing every record in order to split each field, then execute INSERT command in order to write a new record into SQL table.
Because I can not forget my days of C (K&R code) I would like to ask if somebody can give some ideas, in order to use all features of C#.
Perhaps some functions, something at help, etc.

Regards



---
Ariel Folonier
San Nicolas
Argentina
__________________
---
Ariel Folonier
San Nicolas
Argentina
Reply With Quote
  #2 (permalink)  
Old April 5th, 2006, 06:09 AM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

your answer isn't in C#.
You have to use the "Bulk Insert" sql function.
If you use Sql Server, you'll find all details on the function in Transact-Sql Help

Reply With Quote
  #3 (permalink)  
Old April 17th, 2006, 01:08 AM
Registered User
 
Join Date: Apr 2006
Location: istanbul, , Turkey.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to panic_attack Send a message via Yahoo to panic_attack
Default


Hi there,
I have worked on "BULK INSERT" command but noticed that
to import a text file to sql by using "bulk insert" command
i do already have a table and import the text file into this table.
But there is a command called "openrowset" with this command
programmer does not have to have a table in database to import a text file by using "openrowset"
does anyone help me with this pls?
i need a command to import a text file into SQL Server 2000 automaticly
"openrowset" does not help me because it has no parameter that you can specify "rowdelimiter" or "fielddelimiter". "bulk insert" doenst help me because i must have a table in database.
as a result i need a command that should be able to do both of this command above. does anyone could help?
or may be there is another way to do it?

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exporting a csv file (comma separated) micharl Beginning VB 6 6 May 7th, 2008 10:10 PM
Comma Separated values aldwinenriquez SQL Server 2005 3 June 1st, 2007 08:52 PM
comma separated list MunishBhatia SQL Server 2000 11 March 21st, 2007 03:56 PM
Comma Separated Column Value thru T-SQL subhendude SQL Server 2000 2 December 12th, 2006 01:42 PM
Select from Comma Separated Values sasidhar79 SQL Server 2000 2 March 28th, 2005 06:58 PM



All times are GMT -4. The time now is 08:40 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.