Click here to Skip to main content
15,913,944 members
Home / Discussions / Database
   

Database

 
AnswerRe: select top, limit 2, 3? Pin
Colin Angus Mackay29-Feb-04 1:57
Colin Angus Mackay29-Feb-04 1:57 
GeneralUpdate Customise Object to Database Pin
Member 435691127-Feb-04 10:26
Member 435691127-Feb-04 10:26 
GeneralRe: Update Customise Object to Database Pin
Mazdak28-Feb-04 4:55
Mazdak28-Feb-04 4:55 
Generalget minor errors via OLEDB Pin
misha_grewal27-Feb-04 2:47
misha_grewal27-Feb-04 2:47 
GeneralRe: get minor errors via OLEDB Pin
Prakash Nadar1-Mar-04 3:12
Prakash Nadar1-Mar-04 3:12 
GeneralRe: get minor errors via OLEDB Pin
Steve S1-Mar-04 6:52
Steve S1-Mar-04 6:52 
GeneralDataSet Clear() performance problem Pin
Dan Bunea27-Feb-04 0:59
Dan Bunea27-Feb-04 0:59 
GeneralRe: DataSet Clear() performance problem Pin
Mike Dimmick27-Feb-04 9:38
Mike Dimmick27-Feb-04 9:38 
It would be helpful if you could post approximate sizes: how many tables are in your DataSet? How many rows in the DataTables? How big is a row?

I suspect you're suffering from a mid-life crisis[^]: the garbage collector is having to collect a lot of medium-aged objects. Instead of passing in a reference to a DataSet, you should probably just create a new one within LoadCompany and return it. Turn LoadCompany into a function:
Public Function LoadCompany(ByVal companyID As Integer) As DataSet
 
  Dim ds As New DataSet
  
  ' ...
  
  DACompanies.Fill(ds)
Keeping the dataset around typically does you no favours, it just wastes memory. A DataSet object is not terribly expensive to create.

Earlier today I was looking at System.Data.dll using Lutz Roeder's Reflector[^], which seems to indicate that Clear doesn't delete any tables already contained in the dataset. It empties them, yes, but doesn't delete them. The DataTable keeps its DataRows in an array, whose size doesn't change when Clear is called (although the rows are freed). You might find that memory is being wasted if a large number of rows have been used in the past.

If you do decide to keep the DataSet around, Reset will clear any contained tables.

Don't fight the garbage collector.

On a final note, there's no need to pass a reference type by reference, unless you want to make the original reference (in the calling function) point to a different object. It's important to understand the difference between a value and reference type. I simply think of a reference type as being the same as a C++ pointer.

Stability. What an interesting concept. -- Chris Maunder
GeneralRe: DataSet Clear() performance problem Pin
Dan Bunea28-Feb-04 23:58
Dan Bunea28-Feb-04 23:58 
GeneralRe: DataSet Clear() performance problem Pin
Mike Dimmick29-Feb-04 7:20
Mike Dimmick29-Feb-04 7:20 
GeneralRe: DataSet Clear() performance problem Pin
Dan Bunea29-Feb-04 20:52
Dan Bunea29-Feb-04 20:52 
GeneralReturning Large DataSet Pin
Dhrubajyoti Dey26-Feb-04 20:28
Dhrubajyoti Dey26-Feb-04 20:28 
GeneralRe: Returning Large DataSet Pin
Spanky329-Feb-04 7:24
Spanky329-Feb-04 7:24 
GeneralRe: Returning Large DataSet Pin
Rob Graham2-Mar-04 16:54
Rob Graham2-Mar-04 16:54 
GeneralMSSQL linked Server Pin
y_seval26-Feb-04 5:17
y_seval26-Feb-04 5:17 
GeneralRe: MSSQL linked Server Pin
Jeff Varszegi29-Feb-04 2:07
professionalJeff Varszegi29-Feb-04 2:07 
GeneralAccessing Excel file with ASP Pin
sschilachi26-Feb-04 4:58
sschilachi26-Feb-04 4:58 
GeneralRe: Accessing Excel file with ASP Pin
Jeff Monheiser1-Mar-04 18:55
Jeff Monheiser1-Mar-04 18:55 
GeneralRe: Accessing Excel file with ASP Pin
Rob Graham3-Mar-04 12:30
Rob Graham3-Mar-04 12:30 
GeneralE-mails, URLs e VarChars Pin
Clickok25-Feb-04 15:28
Clickok25-Feb-04 15:28 
GeneralRe: E-mails, URLs e VarChars Pin
Jon Sagara25-Feb-04 16:00
Jon Sagara25-Feb-04 16:00 
GeneralRe: E-mails, URLs e VarChars Pin
Bryan Steinberg25-Feb-04 16:07
Bryan Steinberg25-Feb-04 16:07 
GeneralRe: E-mails, URLs e VarChars Pin
Clickok26-Feb-04 5:15
Clickok26-Feb-04 5:15 
GeneralRe: E-mails, URLs e VarChars Pin
Mike Dimmick29-Feb-04 7:38
Mike Dimmick29-Feb-04 7:38 
GeneralRe: E-mails, URLs e VarChars Pin
Clickok29-Feb-04 9:07
Clickok29-Feb-04 9:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.