none
Remote Data Performance RRS feed

  • Question

  • Is dataset performance affected if all the tableadapters are located in 1 dataset or is it better to separate the tableadapters into sep. dataset files, eventhough the table are contained in the same Database

     

    SQL Server Express 2005.

     

    Connecting remotley through an IP address and useres log inthrough SQL server authentication using a windows forms login form.

     

    I have noticed (it seems) that my one dataset that has a bucnh of tabels (18+) in it loads slow, vs. a dataset with 2 tables in it from the same database.

     

    Thanks!

    Thursday, January 31, 2008 2:36 PM

Answers

  • The DataReader because it implements the IDisposable interface you just start your code in C# the second Using statement, in VB.NET 2.0 the Using statement and the system calls dispose for you automatically if you are not using any streams in your operation.  If you are using any streams then you need to call dispose bool on that operation because the streams uses unmanaged resources.

     

    Thursday, January 31, 2008 5:06 PM

All replies

  • The location is usually not relevant but a DataSet with 18 tables you need to make sure all your connection object closed when not used.

     

    Thursday, January 31, 2008 3:39 PM
  • I might be a bit naive here, but I thought that this was automatically done after the dataset was filled (tableadpater.fill).

     

    Would this affect the performance?

     

    Thursday, January 31, 2008 3:46 PM
  • Actually no because nothing in the DataSet implements the IDisposable interface, I just helped another user whose application was failing on load but it was open connections.

     

    So it will not only affect performance it can kill your application.

     

    Thursday, January 31, 2008 3:54 PM
  • So...the inevitable question...after fill, how do I close the connection since I am not declaring a sql instance?

     

    Thursday, January 31, 2008 4:25 PM
  • If any of your operation is a read operation you need to move that to the DataReader it implements IDispoable or use the Enterprise library most of the work is done for you more DataReader than Dataset.

     

    Thursday, January 31, 2008 4:32 PM
  • It is actually about the same for both (read & write operations)

     

    I will check out the datareader & see what it's all about...I hvae never used it before.

     

    V

     

    Thursday, January 31, 2008 4:58 PM
  • The DataReader because it implements the IDisposable interface you just start your code in C# the second Using statement, in VB.NET 2.0 the Using statement and the system calls dispose for you automatically if you are not using any streams in your operation.  If you are using any streams then you need to call dispose bool on that operation because the streams uses unmanaged resources.

     

    Thursday, January 31, 2008 5:06 PM
  • Hey...I appreciate the info.

     

    Helps out!

     

    Thanks!

     

    Thursday, January 31, 2008 5:11 PM