# best method to store and retrive LARGE data files

**URL:** <https://forums.thehomestack.io/t/best-method-to-store-and-retrive-large-data-files/193>\
**Category:** vb.Net\
**Created:** [January 11, 2005, 3:20am UTC](https://forums.thehomestack.io/t/best-method-to-store-and-retrive-large-data-files/193 "2005-01-11T03:20:42Z")\
**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:** [January 11, 2005, 3:20am UTC](https://forums.thehomestack.io/t/best-method-to-store-and-retrive-large-data-files/193/1 "2005-01-11T03:20:42Z")

</div>

Lets say for arguments sake you have 3 fields, colon ( : ) delimited.  
Example:

Test1:Test2:Test3

```auto

Dim sr as New StreamReader("PathToYourFile\FileName.txt") 
Dim line, vals() as String 

Dim dt as New DataTable("Content") 
dt.Columns.Add("Test1") 
dt.Columns.Add("Test2") 
dt.Columns.Add("Test3") 
Dim dr as DataRow 

Do 
   line = sr.ReadLine 
   If line is Nothing Then Exit Do 
   vals = line.Split(":") 
   If vals.Length < 3 Then 
     'Add error handling here 
   Else 
     dr = dt.NewRow 
     dr.Item("Test1") = vals(0) 
     dr.Item("Test2") = vals(1) 
     dr.Item("Test3") = vals(2) 
     dt.Rows.Add(dr) 
   End If 
Loop 

Dim ds as New DataSet("DATA") 
ds.Tables.Add(dt) 
ds.WriteXML("somePath\yourfilename.xml") 
sr.Close() 
sr = Nothing 
ds.Dispose()

```
