472,980 Members | 2,202 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

How do you move a comma delimited text file with 3 fields into a SQL 2000 table


Hello All,

I have a comma delimited text file, which I would like to move into a
SQL 2000 table . I created a DTS package in SQL Server and saved it as a
VB.bas . I am writting the code in C# and I though that I might be able
to change a few lines and keep the bulk of the code. However , it seems
that there is a pretty big change in how VB is written and how C#.net is
written. Does anyone have an example of using DTS and C# to move a few
hundred records into a SQL Server table?

Thank You in Advance for Your Help,
Ken
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #1
2 2050
Hi Kenneth,

Are you going to do this more than once? if not just use the DTS of the SQL
server and that's all
if y ou are planning doing it more than once then I think that it's better
if you do it all in code, something like this:

open file
open DB connection
while ( line=file.ReadLine()!=null )
{
string[] fields = line.Split( new char {','} );
CreateSQL Command
Execute SQL Command
}
close DB connection
close file

I think that it's the best solution in your case

Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Kenneth Koski" <kk*****@mindspring.com> wrote in message
news:ul**************@TK2MSFTNGP10.phx.gbl...

Hello All,

I have a comma delimited text file, which I would like to move into a
SQL 2000 table . I created a DTS package in SQL Server and saved it as a
VB.bas . I am writting the code in C# and I though that I might be able
to change a few lines and keep the bulk of the code. However , it seems
that there is a pretty big change in how VB is written and how C#.net is
written. Does anyone have an example of using DTS and C# to move a few
hundred records into a SQL Server table?

Thank You in Advance for Your Help,
Ken
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 15 '05 #2

Hi Kenneth,

There is a book talked about how to use Sql Server 2000 DTS in .Net
environment with C#, you can download it from the the link below:
http://www.sqldev.net/dts/DotNETCookBook.htm

Hope this helps,
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: Kenneth Koski <kk*****@mindspring.com>
| X-Newsreader: AspNNTP 1.50 (ActionJackson.com)
| Subject: How do you move a comma delimited text file with 3 fields into a
SQL 2000 table
| Mime-Version: 1.0
| Content-Type: text/plain; charset="us-ascii"
| Content-Transfer-Encoding: 7bit
| Message-ID: <ul**************@TK2MSFTNGP10.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| Date: Mon, 29 Sep 2003 08:20:01 -0700
| NNTP-Posting-Host: actionjackson133.dsl.frii.net 216.17.147.133
| Lines: 1
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:188001
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
|
| Hello All,
|
| I have a comma delimited text file, which I would like to move into a
| SQL 2000 table . I created a DTS package in SQL Server and saved it as a
| VB.bas . I am writting the code in C# and I though that I might be able
| to change a few lines and keep the bulk of the code. However , it seems
| that there is a pretty big change in how VB is written and how C#.net is
| written. Does anyone have an example of using DTS and C# to move a few
| hundred records into a SQL Server table?
|
| Thank You in Advance for Your Help,
| Ken
|
|
| *** Sent via Developersdex http://www.developersdex.com ***
| Don't just participate in USENET...get rewarded for it!
|

Nov 15 '05 #3

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

Similar topics

3
by: Elmo Watson | last post by:
I've been asked to develop a semi-automated type situation where we have a database table (sql server) and periodically, there will be a comma delimited file from which we need to import the data,...
1
by: DCM Fan | last post by:
Access 2K, SP3 on Windows 2K, SP4 All, I have an import spec set up with quoted Identifiers and comma-separated values. The text file is produced by a 3rd-party program of which I have no...
4
by: Jim's wife | last post by:
My access table when exported to a comma delimited field gets all messed up because some of the fields have the double quote character - ". Used for measurements and other things. I guess I will...
1
by: sparks | last post by:
I have never done this and wanted to ask people who have what is the best way. One person said import it to excel, then import it into access table. but since this will be done a lot, I am...
1
by: John B. Lorenz | last post by:
I'm attempting to write an input routine that reads from a comma delimited file. I need to read in one record at a time, assign each field to a field array and then continue with my normal...
5
by: Yama | last post by:
Hi, I am looking to create a report comma delimited on a click of a button. Explanantion: 1. Get from the database: "SELECT * FROM Customers WHERE Region = 'CA'" 2. Use either DataReader or...
9
by: Bernie Yaeger | last post by:
Is there a way to convert or copy a .xml file to a comma delimited text file using vb .net? Thanks for any help. Bernie Yaeger
3
by: Avi | last post by:
I need to create a text file that has the data from the 10 tables in the database. The number of fields in the tables exceeds 255 and so I cannot make a new table with all the fields and then...
3
by: Bertie Brink | last post by:
I am trying to read comma delimited rows of text. The problem is that some fields may be encapsulated in "" - particularly the text fields but not numeric fields. Is there a simple efficient way...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.