I have a csv file in drive C: when I am going to display in datagridview but the 1st line is not display in gatagridview, My csv file content data is as follows


My code is below:

Dim csvFileFolder As String = "C:\"
        Dim csvFileName As String = "Test2.csv"

        Dim connString As String = "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" _
            & csvFileFolder & ";Extended Properties=""Text;HDR=No;FMT=Delimited"""
        Dim conn As New Odbc.OdbcConnection(connString)

        'Open a data adapter, specifying the file name to load
        Dim da As New Odbc.OdbcDataAdapter("SELECT * FROM [" & csvFileName & "]", conn)
        'Then fill a data table, which can be bound to a grid
        Dim dt As New DataTable

        DataGridView2.DataSource = dt

somebody please help me to resolve the problem

This is just a wild shot, so please don't nail me on it.
But could it be that the datagrid is expecting the column names in the first row?
So you could try to add in the very first line the column names and see what is going on.
There is might be a extended option in the connection string where you can define if the first row are column names or not.

Imports System.IO
Imports System.Data.OleDb
Public Class Form1

    '1 DataGridView - dgv_csv
    'See Attached jpg's

  Private Sub Form1_Load(ByVal sender As System.Object, _
                         ByVal e As System.EventArgs) Handles MyBase.Load

    Dim dt As New DataTable
    dt = CreateDataTableFrom_CSV("Sample.csv", _

    dgv_csv.DataSource = dt

  End Sub

  Private Function CreateDataTableFrom_CSV(ByVal csvFileName As String, _
                                           ByVal csvDir As String) As DataTable

    Dim strConnString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & csvDir & _
                                  ";Extended Properties=""Text;HDR=No;FMT=Delimited"""

    Dim conn As New OleDbConnection(strConnString)
      Dim cmd As New OleDbCommand("SELECT * FROM [" & csvFileName & "]", conn)
      Dim da As New OleDbDataAdapter()
      Dim ds As New DataSet

      da.SelectCommand = cmd

      'If you want to create Headers uncomment the following 
      'and comment out the return ds.Tables(0)
      'Or add the Headers to the csv file on the first line 
      'and change HDR=No to Yes in the connection string. 
      'Which way is easier is up to you.

      '****************************To Add Headers***************************
      'Dim dt As New DataTable
      'dt = CreateDataTable("Sample")

      'Dim i As Integer = 0
      'For Each rw As DataRow In ds.Tables(0).Rows
      '  dt.Rows.Add()
      '  dt.Rows(i).Item(0) = rw.Item(0)
      '  dt.Rows(i).Item(1) = rw.Item(1)
      '  dt.Rows(i).Item(2) = rw.Item(2)
      '  dt.Rows(i).Item(3) = rw.Item(3)
      '  dt.Rows(i).Item(4) = rw.Item(4)
      '  dt.Rows(i).Item(5) = rw.Item(5)
      '  dt.Rows(i).Item(6) = rw.Item(6)
      '  dt.Rows(i).Item(7) = rw.Item(7)
      '  dt.Rows(i).Item(8) = rw.Item(8)
      '  i += 1

      'Return dt
      '***************************End Add Headers****************************

      Return ds.Tables(0)   'Comment Out For The Headers

    Catch ex As Exception
      Return Nothing
    End Try

  End Function

  Public Function CreateDataTable(ByVal tableName As String) As DataTable

    Dim dt As New DataTable
    dt.Columns.Add("NAME", GetType(System.String))
    dt.Columns.Add("Value", GetType(System.Decimal))
    dt.Columns.Add("DATE", GetType(System.DateTime))
    dt.Columns.Add("Time", GetType(System.DateTime))
    dt.Columns.Add("Value2", GetType(System.Decimal))
    dt.Columns.Add("Value3", GetType(System.Decimal))
    dt.Columns.Add("Value4", GetType(System.Decimal))
    dt.Columns.Add("Value5", GetType(System.Decimal))
    dt.Columns.Add("Value6", GetType(System.Decimal))
    dt.TableName = tableName
    Return dt

  End Function

End Class