Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create dataset from non-delimited text file

Status
Not open for further replies.

HomerJS

Programmer
Jun 25, 2001
86
0
0
US
I have a non-delimited text file where I extract 4 different repeating items from. I want to put those 4 variables into a dataset. I've tried creating a datatable but cannot figure out how to create datarows manually. Is this the best way or how can I get the data into a dataset?
 
To get a new row into a datatable:

Dim dt as New DataTable

Dim Col1 as DataCoulmn
Dim Col2 As DataColumn

Col1 = New DataColumn("Col1")
Col2 = New DataColumn("Col2")

dt.Columns.Add(Col1)
dt.Columns.Add(Col2)

Dim dr as DataRow

dr = dt.NewRow()

With dr
.Item("Col1") = SomeValue
.Item("Col2") = SomeOtherValue
End With

dt.Rows.Add(dr)


I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top