Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4000076
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:44:12+00:00 2026-05-20T07:44:12+00:00

i need to import some bulk data in an asp.net application from txt/csv files

  • 0

i need to import some bulk data in an asp.net application from txt/csv files

until now i used SqlBulkCopy, but now on iis7 with 64bit it doesn’t work. there are many posts about jet not working with 64bit.

i read that iis can be configured to work in 32 bit mode, but id rather keep performance as good as possible via 64bit.

additionally, i never quite managed to make sqlbulkcopy use the extended properties (as you might see here https://stackoverflow.com/questions/4305502/net-sqlbulkcopy-with-unicode-chars or here http://forums.asp.net/p/1627034/4184689.aspx#4184689?SqlBulkCopy+DATAFILETYPE+widechar)

so the question is, is there another/better method to import bulk records to mssql via .net? something that works fine with 64bit and allows for customization as to unicode & filetypes?

thank you all for helping out!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T07:44:13+00:00Added an answer on May 20, 2026 at 7:44 am

    thanks for your answers, fellows.

    though it seems that the easiest way to go, is manually. so i started writing some code myself. and ill post it here if anyone might find some interest in it

    it may not cover everything, but it is pretty flexible.

    it does use some of my helper functions and such, not listed here, so if you’re reading this and cannot figure out something, ill be glad to elaborate 🙂

    Sub ImportFile(ByVal FilePath As String, ByVal RecordType As ObjectType, Optional ByVal HasHeaders As Boolean = True, Optional ByVal RowDelimiter As String = ControlChars.Tab, Optional ByVal CellDelimiter As String = ControlChars.NewLine)
        Dim objReader = New StreamReader(FilePath)
        Dim strContents = objReader.ReadToEnd
        objReader.Close()
        Dim Columns = New List(Of String)
        Dim axName = ObjectType.Account.GetType.Assembly.FullName
        Dim objRecord = Activator.CreateInstance(axName, RecordType.ToString).Unwrap
        Dim dcx = DBContext()
        dcx.EditLogging = False
        Dim tbl = dcx.GetTable(objRecord.GetType)
    
        Dim TableColumns = New List(Of String)
        For Each p In objRecord.GetType.GetProperties
            If (p.PropertyType.BaseType IsNot Nothing AndAlso p.PropertyType.BaseType.Name = "ValueType") Or p.PropertyType Is "".GetType Then TableColumns.Add(p.Name)
        Next
    
        Dim Rows = Split(strContents, RowDelimiter).ToList
        If HasHeaders Then
            Columns = Rows(0).Split(CellDelimiter).ToList
            Rows.RemoveAt(0)
            'check validity
            For Each clm In Columns
                If Not TableColumns.Contains(clm) Then Throw New ApplicationException(clm & " is not a valid column name.")
            Next
        Else
            Columns = TableColumns
        End If
        For Each row In Rows
            objRecord = Activator.CreateInstance(axName, RecordType.ToString).Unwrap
            Dim Cells = row.Split(CellDelimiter)
            For i = 0 To Cells.Count - 1
                SetObjProperty(objRecord, Columns(i), Cells(i))
            Next
            tbl.InsertOnSubmit(objRecord)
        Next
        dcx.SubmitChanges()
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In our application we need to import transaction data from paypal through an API
php newbie here..I need some PHP help ideas/examples on how to import data from
I need to import a huge csv data file (6880 columns) and I need
I need to import some data to show it for user but page execution
I need to import multiple csv files, compressed in a zipped folder. I am
I need to import a csv file into Firebird and I've spent a couple
I need to import largish (24MB) text files into a MySQL table. Each line
I need to import a large CSV file into an SQL server. I'm using
I'm using Grails 1.1 beta2. I need to import a large amount of data
I have a PDF file, which contains data that we need to import into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.