Re: Close - No Dispose - Memory Leak?

Tech-Archive recommends: Fix windows errors by optimizing your registry



Gentlemen thank you for your responses, it was very informative. I
think that William identified for me what I needed to know. After
profiling the application I found that there were a lot of long lived
objects and, surprisingly, there were a lot more String objects then
ADO.NET objects.

So I will keep beating the system and try to find out why it is
thrashing the server.

FYI, here is how I would prefer to do the data access:

public static string SomeFunction(int someId)
{

string commandText = "storedProcName";

SqlParameter[] param = new SqlParameter[1];
param[0] = new SqlParameter("@some_id", SqlDbType.Int, 4);
param[0].Value = someId;

string returnValue = string.Empty;

using(SqlConnection conn = new
SqlConnection(AStaticConnectionString))
{
// Using the Micorsoft SqlHelper Object
returnValue = SqlHelper.ExecuteScalar(
conn
,CommandType.StoredProcedure
, commandText
, param).ToString();
}

return returnValue;
}

.



Relevant Pages

  • Re: reading a loong table of numbers
    ... figure out whether the item is a string or a number. ... I would have made sure that!read-from-string and!parse-integer were ... Profiling results for reading three files four times each: ...
    (comp.lang.lisp)
  • Re: Big-Picture Question (Web Services, RegNow)
    ... I just tried returning a string array. ... there is no way to name each of the string fields returned. ... public ReturnValue GetRegistrationCode() ... But only seems like it would be harder for the consumer of my Web service to deal with. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ANNOUNCE: DBI 1.54 RC6 - including cool new DBD::Gofer stateless proxy
    ... FAILED tests 1-6 ... 44/137 skipped: various reasons ... all skipped: profiling not supported for DBI::PurePerl ... Use of uninitialized value in string eq at ./t/10examp.t line 125. ...
    (perl.dbi.users)
  • Re: Please Help - Trying to Launch IE from Excel
    ... Thanks for the many responses. ... Thanks again to Tim and everyone else who responded. ... ByVal lpFile As String, ByVal lpParameters As String, _ ... ShellExecute 0, vbNullString, WEB_SITE_URL, vbNullString, _ ...
    (microsoft.public.excel.programming)
  • Re: client/server socket problem(server core dumping)
    ... responses, I'll take a shot anyway -- have you ... considered a situation where a client sends a ... full string? ... unrelated code have made you more likely to have had a useful reply? ...
    (comp.unix.programmer)