Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Datagrid doesn't import all my .csv data !!

Datagrid doesn't import all my .csv data !!

Scheduled Pinned Locked Moved Visual Basic
question
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    blonkie
    wrote on last edited by
    #1

    I have an datagrid who is filled automaticly by an .csv file Private Sub frmCsv_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim file As String = "steelandt.csv" Dim pad As String = "C:\" Dim dataset As New DataSet Try Dim bestand As System.IO.File If bestand.Exists(pad & file) Then Dim ConStr As String = _ "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _ pad & ";Extended Properties=""Text;HDR=Yes;FMT=Delimited\""" Dim conn As New OleDb.OleDbConnection(ConStr) Dim databaseAdapter As New OleDb.OleDbDataAdapter("Select [PO],[Item],[Due Date],[Item Description] from " & _ file + " WHERE PO>0 order by PO ASC", conn) databaseAdapter.Fill(dataset) End If Catch ex As Exception MessageBox.Show(ex.ToString) End Try DataGrid.DataSource = dataset.Tables(0) Now as you can see I import just 4 columns (PO, Item,Due Date and Item description) When I run the program everything works except : It doesn't load the item and due date colum.... and to make it worse, it imports just a few values of the column item How come ??

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups