I am having a most strange issue. I have two versions of the same code:
 CODE - version #1 cmd.CommandType = CommandType.StoredProcedure

If iPlanetLogin_OR_UserDotIdentityDotName.StartsWith("AMG\") Then
cmd.CommandText = "dbo.Persons_get_DomainAccount"
cmd.Parameters.Add("@DomainAccount", iPlanetLogin_OR_UserDotIdentityDotName)
Else
cmd.CommandText = "dbo.persons_get_iPlanetAccount"
cmd.Parameters.Add("@iPlanetAccount", 
iPlanetLogin_OR_UserDotIdentityDotName)
End If
 and:
 CODE - version #2 If 
iPlanetLogin_OR_UserDotIdentityDotName.StartsWith("AMG\") Then
cmd.CommandText = "dbo.Persons_get_DomainAccount '" & 
iPlanetLogin_OR_UserDotIdentityDotName & "'"
Else
cmd.CommandText = "dbo.persons_get_iPlanetAccount '" & 
iPlanetLogin_OR_UserDotIdentityDotName & "'"
End If

The first one creates 6 connections in the database, as is evidenced by:
 SELECT count(*) as PurchIS_Connections
FROM Master.dbo.SysProcesses
WHERE DBID IN (SELECT DBID 
FROM Master.dbo.SysDatabases 
WHERE [Name] LIKE '%PurchIs%' )
and loginame ='PurchIS'

and the second section of code only creates *3* connections.

First of all, why are multiple connections being created here at all?
Secondly, why should using parameters (i.e. setting cmd.CommandType = 
CommandType.StoredProcedure) double the number of connections at all? Isn't 
that the proper way to do call a SP in
ADO<http://www.tek-tips.com/viewthread.cfm?qid=1103710&page=1#>
.NET?!

I have so many connections to the DB! Please help...

Thanks,
Eliezer


[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12he5jqka/M=362131.6882499.7825260.1510227/D=groups/S=1705006764:TM/Y=YAHOO/EXP=1123279682/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life 
- brought to you by One Economy</a>.</font>
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to