Code looks like this:
myReader = File.OpenText("\\Barracuda\MIS Documents\Autocar\imperialvdmstr.txt"
'read data in from imperialvdmstr and place in database
While myReader.Peek <> -1
'newRow = dtImperialVDMstr.NewRow()
newRow = DsImperialMstr1.Imperialvdmstr.NewRow
'read line of text
myStringImperialVDMstr = myReader.ReadLine
myStringImperialVDMstr = myStringImperialVDMstr & " "
'use myString to divide up the data
'add text info to appropriate field
newRow("vendor_id" = myStringImperialVDMstr.Substring(0, 6)
newRow("vendor_name" = myStringImperialVDMstr.Substring(6, 25)
newRow("Vendor_abbrev" = myStringImperialVDMstr.Substring(31, 10)
newRow("vendor_address_1" = myStringImperialVDMstr.Substring(41, 25)
newRow("vendor_address_2" = myStringImperialVDMstr.Substring(66, 25)
newRow("Vendor_city" = myStringImperialVDMstr.Substring(91, 25)
newRow("Vendor_state" = myStringImperialVDMstr.Substring(116, 2)
newRow("vendor_zip" = myStringImperialVDMstr.Substring(118, 10)
newRow("vendor_country" = myStringImperialVDMstr.Substring(128, 3)
newRow("vendor_phone" = myStringImperialVDMstr.Substring(131, 20)
newRow("vendor_fax" = myStringImperialVDMstr.Substring(151, 20)
newRow("vendor_terms_code" = myStringImperialVDMstr.Substring(171, 3)
newRow("vendor_terms_desc" = myStringImperialVDMstr.Substring(174, 25)
newRow("vendor_contact" = myStringImperialVDMstr.Substring(199, 25)
newRow("blanket_order_ok" = myStringImperialVDMstr.Substring(224, 1)
newRow("tax_suffix" = myStringImperialVDMstr.Substring(225, 5)
newRow("sales_tax_id_1" = myStringImperialVDMstr.Substring(230, 15)
newRow("sales_tax_id_2" = myStringImperialVDMstr.Substring(245, 15)
newRow("purchase_lead_time" = myStringImperialVDMstr.Substring(259, 3)
'add new row for the dataset.table
DsImperialMstr1.Tables("imperialvdmstr".Rows.Add(newRow)
newRow = Nothing
End While
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
When I hit around the 50,000 mark the process becomes so slow that it does about 1 record per/second.
Is their any quicker way to add these to the database from a fixed length file.
myReader = File.OpenText("\\Barracuda\MIS Documents\Autocar\imperialvdmstr.txt"
'read data in from imperialvdmstr and place in database
While myReader.Peek <> -1
'newRow = dtImperialVDMstr.NewRow()
newRow = DsImperialMstr1.Imperialvdmstr.NewRow
'read line of text
myStringImperialVDMstr = myReader.ReadLine
myStringImperialVDMstr = myStringImperialVDMstr & " "
'use myString to divide up the data
'add text info to appropriate field
newRow("vendor_id" = myStringImperialVDMstr.Substring(0, 6)
newRow("vendor_name" = myStringImperialVDMstr.Substring(6, 25)
newRow("Vendor_abbrev" = myStringImperialVDMstr.Substring(31, 10)
newRow("vendor_address_1" = myStringImperialVDMstr.Substring(41, 25)
newRow("vendor_address_2" = myStringImperialVDMstr.Substring(66, 25)
newRow("Vendor_city" = myStringImperialVDMstr.Substring(91, 25)
newRow("Vendor_state" = myStringImperialVDMstr.Substring(116, 2)
newRow("vendor_zip" = myStringImperialVDMstr.Substring(118, 10)
newRow("vendor_country" = myStringImperialVDMstr.Substring(128, 3)
newRow("vendor_phone" = myStringImperialVDMstr.Substring(131, 20)
newRow("vendor_fax" = myStringImperialVDMstr.Substring(151, 20)
newRow("vendor_terms_code" = myStringImperialVDMstr.Substring(171, 3)
newRow("vendor_terms_desc" = myStringImperialVDMstr.Substring(174, 25)
newRow("vendor_contact" = myStringImperialVDMstr.Substring(199, 25)
newRow("blanket_order_ok" = myStringImperialVDMstr.Substring(224, 1)
newRow("tax_suffix" = myStringImperialVDMstr.Substring(225, 5)
newRow("sales_tax_id_1" = myStringImperialVDMstr.Substring(230, 15)
newRow("sales_tax_id_2" = myStringImperialVDMstr.Substring(245, 15)
newRow("purchase_lead_time" = myStringImperialVDMstr.Substring(259, 3)
'add new row for the dataset.table
DsImperialMstr1.Tables("imperialvdmstr".Rows.Add(newRow)
newRow = Nothing
End While
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
When I hit around the 50,000 mark the process becomes so slow that it does about 1 record per/second.
Is their any quicker way to add these to the database from a fixed length file.