StreamReader and DataSet population
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: StreamReader and DataSet population

  1. #1
    Join Date
    Apr 2006
    Posts
    2

    StreamReader and DataSet population

    I have a class in my project which is an object for Microsoft report viewer dataset.
    The object is loaded by the report and displayed properly if manually loaded by rows.add() method.

    When I use a streamreader object to read a text file and populate the report in the class contructor , the data gets loaded, but the IDE becomes unstable. After stopping the debugging if we try to view the datasourse tab IDE will show a box saying that the data sourse text file was not found in Visual studio directory. if we comment the streamReader part again it will be ok but data cannot be populated then.

    Any clue?

    Thanks
    Roy Thomas

  2. #2
    Join Date
    Mar 2004
    Location
    Prague, Czech Republic, EU
    Posts
    1,701

    Re: StreamReader and DataSet population

    Make sure that, you close the stream after you load all data from it. Also don't forget, that working directory of IDE is different from working directory from debugged app, so file which you are able access from application may not be accessible from IDE. Maybe IDE is trying to instantinate the object to inspect, if so, it calls the constructor which try to load the file for which it looks in working directory of IDE, where it may not existst.
    • Make it run.
    • Make it right.
    • Make it fast.

    Don't hesitate to rate my post.

  3. #3
    Join Date
    Apr 2006
    Posts
    2

    Re: StreamReader and DataSet population

    Thanks for the response I will check it.

    But IDE correctly views the object if the streamreader is not used.

    Also, should i make a filestream object and call streamreader? Now I am directly passing the text tfile to streamreader. it is working . What is the correct method?

    Thanks.

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center