Home All Groups Group Topic Archive Search About
Author
30 Mar 2005 10:24 AM
Matthias von Deetzen
Hallo zusammen,

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

Mfg

Matthias

Author
30 Mar 2005 10:37 AM
Crouchie1998
English please

Something to do about a CSV date in a datagrid I think
Author
30 Mar 2005 11:28 AM
Cor Ligthert
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(ByVal sender As Object, _
    ByVal e As System.EventArgs) 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=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
              path & ";Extended Properties=""Text;HDR=No;FMT=Delimited\"""
              Dim conn As New OleDb.OleDbConnection(ConStr)
              Dim da As New OleDb.OleDbDataAdapter("Select * from " & _
              file, conn)
              da.Fill(ds, "TextFile")
          End If
     Catch ex As Exception
            MessageBox.Show(ex.ToString)
     End Try
   DataGrid1.DataSource = ds.Tables(0)
End Sub
///
I hope this helps a little bit?

Cor>
Author
30 Mar 2005 12:01 PM
Herfried K. Wagner [MVP]
"Matthias von Deetzen" <matthias.von.deet***@consulting-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.connectionstrings.com/>.

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