Results 1 to 5 of 5

Thread: problem with streamreader or sql server?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2002
    Posts
    164

    problem with streamreader or sql server?

    Hi all
    I have a text file with more than 4000 lines in it.
    Each line is of around 400 characters.
    In order to mearge this file in one of the table from sql server 2005,
    I am reading this file line by line using stramreader class.
    I then split the line in 20 field using based on delimeter.
    I declared 20 parameters and pass these parameters to a sql stor proc
    for inserting the record.
    It works fine with small files (less records).
    But for big files, it inserts aprrox 2600 (it varies each time) lines to table
    and then throgh the error.
    Is this due to
    1> any buffer size limitation for stream reader
    2> code is calling stor proc for each line and so sql server processign so many stor procs?
    Please help
    Thanks
    Radhesham

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: problem with streamreader or sql server?

    Look into using the BulkCopy class in SQLClient.... I've been using it to pulling in data from DBF databases. It's fast and easy to use.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: problem with streamreader or sql server?

    What is the error?

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Jul 2002
    Posts
    164

    Re: problem with streamreader or sql server?

    The Error message is
    Request Timed Out
    Please help.
    thanks in advance
    Radhesham

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: problem with streamreader or sql server?

    Yeah you probably do want BulkCopy then.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width