M
Marc Miller
I have a non-delimited fixed-field text file with a record length of 5919
bytes long that I need
to load into an existing empty dataset with 159 columns.
Currently I am building a mapping like this:
Do While sr.Peek() >= 0
dr = dt.NewRow
dt.Rows.Add(dr)
Dim nLine As String = sr.ReadLine()
dt.Rows(iRow).Item("HH") = nLine.Substring(0, 2)
dt.Rows(iRow).Item("MM") = nLine.Substring(2, 2)
dt.Rows(iRow).Item("District") = nLine.Substring(4, 4)
dt.Rows(iRow).Item("Exchange") = nLine.Substring(8, 8)
dt.Rows(iRow).Item("Remote") = nLine.Substring(16, 8)
dt.Rows(iRow).Item("Company") = nLine.Substring(24, 3)
'''' ETC, ETC, ETC for 159 columns!..................................
Loop
Is there some sort of 'bulk load' the data? This seems awfully cumbersome.
Thanks in advance to all,
Marc
bytes long that I need
to load into an existing empty dataset with 159 columns.
Currently I am building a mapping like this:
Do While sr.Peek() >= 0
dr = dt.NewRow
dt.Rows.Add(dr)
Dim nLine As String = sr.ReadLine()
dt.Rows(iRow).Item("HH") = nLine.Substring(0, 2)
dt.Rows(iRow).Item("MM") = nLine.Substring(2, 2)
dt.Rows(iRow).Item("District") = nLine.Substring(4, 4)
dt.Rows(iRow).Item("Exchange") = nLine.Substring(8, 8)
dt.Rows(iRow).Item("Remote") = nLine.Substring(16, 8)
dt.Rows(iRow).Item("Company") = nLine.Substring(24, 3)
'''' ETC, ETC, ETC for 159 columns!..................................
Loop
Is there some sort of 'bulk load' the data? This seems awfully cumbersome.
Thanks in advance to all,
Marc