Solved

import csv >1000 cols

Posted on 2004-09-10
5
425 Views
Last Modified: 2008-03-06
is there a way to import csv to a temp db with cols > 1000 the csv has no col names. if so how?
0
Comment
Question by:afreer2
5 Comments
 
LVL 27

Expert Comment

by:planocz
ID: 12025632
At this link you can make your csv to a dataset them import it to your Database.

http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/Q_20607244.html
0
 
LVL 3

Expert Comment

by:RacinRan
ID: 12026625
If you are using SQL Server 2000:  

You can use Data Transformation Services (DTS) to import the file directly, bypassing the need to use .Net.  If you need to do this routinely, the DTS package can be scheduled to run by the server.

SQL Server can import 1000 rows per second or two...
0
 
LVL 4

Expert Comment

by:srcalc
ID: 12027440
0
 

Author Comment

by:afreer2
ID: 12031677
I apoligize to all of you for putting my comments in your feedback insted of here. having said that I will try to explain what i'm trying to do.
since i'm new at programing I want to start slow and don't want to add any new things to learn to reach my goal,which is:
a: after I downloaded a csv file I want to automate as much as possibe using (I hope this is the right term) fileDialog to pick the right csv file,there may be many,and put certain rows in many tables. I don't need all the rows all the time because the use of these file may change. Im trying to handicap horses and new ideas may come up and I may want to use the same info in different ways. I don't want to use a server because I only use one computer. The comment from srcalc looks promising but I'd have to learn a lot more to make it work. I also like the idea to use sql to put the info where I want it,but that to will take time for me to learn.
Anyway after I picked a race(csv) that I beleve is a string I can use to put in the program to tell another part of the program what to do with the csv. I don't know if this is clear so I''ll wait for mor input.
thanks again
0
 
LVL 4

Accepted Solution

by:
srcalc earned 500 total points
ID: 12032523
The link I posted earlier amounts to basically this code:

                Dim openDialog As New OpenFileDialog
                openDialog.Filter = "CSV files (*.csv)|*.csv|All files (*.*)|*.*"
                openDialog.ShowDialog()
                Dim File As New System.IO.FileInfo(openDialog.FileName)
                Dim DBConnection As New System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & File.DirectoryName & ";Extended Properties='text;HDR=Yes;FMT=Delimited'")
                Dim DBadapter As New System.Data.OleDb.OleDbDataAdapter("SELECT * FROM " & File.Name, DBConnection)
                Dim dTable As New System.Data.DataTable
                DBadapter.Fill(dTable)

This code will make and show an open file dialog box allowing selection of a CSV, then fill a datatable with all the information from the file chosen.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Help with sorting data in Listbox using VB.NET 3 60
Get hold of longitude and latitude in iframe string 11 45
.NET 2008 VB and C# 6 27
Expression Evaluater 3 24
This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question