473,671 Members | 2,194 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CSV-Datei einlesen

Hallo zusammen,

ich suche eine Möglichkeit eine CSV Datei in einem DataGrid anzuzeigen.

Mfg

Matthias

Nov 21 '05 #1
3 3053
English please

Something to do about a CSV date in a datagrid I think
Nov 21 '05 #2
Matthias,

See this old sample of me, be aware of the csv delimiter I don't know if it
is in Germany/Swiss/Italy/Austria/Belgia/Liechtenstein a semicolon or a
comma. Next time please in English, that is the used language in this
newsgroup, although many are not native English speakers.
\\\\
Private Sub Form1_Load(ByVa l sender As Object, _
ByVal e As System.EventArg s) Handles MyBase.Load
Dim file As String = "Test2.txt"
Dim path As String = "C:\Test1\"
Dim ds As New DataSet
Try
Dim f As System.IO.File
If f.Exists(path & file) Then
Dim ConStr As String = _
"Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=" & _
path & ";Extended Properties=""Te xt;HDR=No;FMT=D elimited\"""
Dim conn As New OleDb.OleDbConn ection(ConStr)
Dim da As New OleDb.OleDbData Adapter("Select * from " & _
file, conn)
da.Fill(ds, "TextFile")
End If
Catch ex As Exception
MessageBox.Show (ex.ToString)
End Try
DataGrid1.DataS ource = ds.Tables(0)
End Sub
///
I hope this helps a little bit?

Cor>
Nov 21 '05 #3
"Matthias von Deetzen" <ma************ ******@consulti ng-company.net>
schrieb:
ich suche eine Möglichkeit eine CSV Datei in einem DataGrid anzuzeigen.


Notice that this is an English language group. You'll find connection
strings for connecting to CSV files at
<URL:http://www.connections trings.com/>.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4

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

Similar topics

0
2081
by: Francis Avila | last post by:
Three things that seem odd with csv: Python 2.3.2 (#49, Oct 2 2003, 20:02:00) on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import csv >>> class unix(csv.Dialect): .... delimiter = ':' .... escapechar = '\\' .... lineterminator = '\n'
5
5363
by: Mark F | last post by:
To say I'm a python newbie would be an understatement but I think it is a language worth learning and would make a great replacement for perl in our shop. I'm trying to read a CSV file using the python csv module but I can't seem to determine how to use the API, it seems to me that I can do nothing more than opening the file and printing the lines of the file. I can do that without the CSV module. I need to know how to address...
2
13889
by: googleboy | last post by:
Hi. I am trying to write out a csv file with | instead of comma, because I have a field that may have many commas in it. I read in a csv file, sort it, and want to write it out again. I read the example that says: import csv writer = csv.writer(open("some.csv", "wb")) writer.writerows(someiterable)
19
3211
by: Johnny Google | last post by:
Here is an example of the type of data from a file I will have: Apple,4322,3435,4653,6543,4652 Banana,6934,5423,6753,6531 Carrot,3454,4534,3434,1111,9120,5453 Cheese,4411,5522,6622,6641 The first position is the info (the product) I want to retreive for the corresponding code. Assuming that the codes are unique for each product and all code data is on one line.
25
12752
by: Ali-R | last post by:
Hi, Is there a parser which parses CSV files? Thanks for your help. Reza
7
15033
by: Ish2000 | last post by:
Hello, I've a simple windows application and i want to be able to convert a csv file to xml. So far, i can browse for the csv file from the file structure and display in a textbox. I want to convert the displayed csv file in the textbox to Xml and use the first line of the csv file as tags. I know there will be different ways of doing this but i would like to keep it simple because i am new to programming and the Visual Basic.Net...
1
4273
by: Simmons, Stephen | last post by:
Hi, I've come across a bug in CSV where the csv.reader() raises an exception if the input line contains '\r'. Example code and output below shows a test case where csv.reader() cannot read an array written by csv.writer(). I believe this is a known bug and may have been fixed for Python 2.5. However I'm after suggestions for workarounds for Python 2.4.2.
22
4973
by: fniles | last post by:
I have a .CSV file (comma delimited) that I want to open using OLEDB, but I get the error "External table is not in the expected format." If I save the .CSV file to an .XLS file, I can open the connection with no problem. What is the correct way to open a .CSV file ? If I can not open the CSV file, how can I programmatically save the CSV file to an XLS file ? Thanks a lot. dim myCon OleDb.OleDbConnection
10
12258
by: CarpeSkium | last post by:
How do I access the value in the second row in the first position of a CSV? Or the 3rd row, in the fifth position? a,b,c,d,e,f,g,h,i j,k,l,m,n,o,p,q,r r,s,t,v,w,x,y,z I'd want to get at "j" and "w". I know I can do import csv
4
4382
by: TC | last post by:
Hey All, I've been searching for a code snippet, not a 3rd party tool, that takes a ..csv file and transforms it to an .xml file based upon an .xsd. Can anyone point me in the right direction or provide a code snippet? I would prefer vb.net but C# is fine too or even pseudo code with appropriate .Net objects and example.
0
8476
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8393
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8914
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8820
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8598
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7433
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6223
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2051
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.