Solved

import csv >1000 cols

Posted on 2004-09-10
5
437 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

636 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