Solved

import csv >1000 cols

Posted on 2004-09-10
5
418 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
Comment Utility
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
Comment Utility
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
Comment Utility
0
 

Author Comment

by:afreer2
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now