# Display data from a text file in datagrid

**URL:** <https://forums.thehomestack.io/t/display-data-from-a-text-file-in-datagrid/221>\
**Category:** vb.Net\
**Created:** [September 11, 2005, 5:44am UTC](https://forums.thehomestack.io/t/display-data-from-a-text-file-in-datagrid/221 "2005-09-11T05:44:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://forums.thehomestack.io/uploads/default/original/1X/161426793bc0d8bdf0d1a6692b3e44446861cc72.jpeg) [@system](https://forums.thehomestack.io/u/system)\
**Post date:** [September 11, 2005, 5:44am UTC](https://forums.thehomestack.io/t/display-data-from-a-text-file-in-datagrid/221/1 "2005-09-11T05:44:50Z")

</div>

```auto

Dim iReader As StreamReader
        Dim col As New DataColumn("SomeText", Type.GetType("System.String"))
        Dim dRow As DataRow
        Dim dSet As New DataSet

        Dim dTable As New DataTable("NewOne")
        iReader = File.OpenText("c:\acctsynclog.txt")
        dTable.Columns.Add(col)

        While iReader.Peek <> -1
            dRow = dTable.NewRow
            dRow(0) = iReader.ReadLine
            dTable.Rows.Add(dRow)
        End While
        iReader.Close()

        dSet.Tables.Add(dTable)

```
