Thanks for your fast reply... Wait a second, are you saying that it's *by 
design* using multiple connections? When this app is released - it'll blow 
up the DB, won't it?
 Eliezer

 On 8/5/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: 
> 
> 
> Let me try to explain:
> 
> With #1, you are supplying all the information that is needed to
> execute the sql. Each bit of information is using a db connection.
> Theoretically, #1 is faster.
> 
> With #2, while only using 3 connections, the process of discovery
> (parameters, SQL text, etc) is using those connecttions, but asking
> a lot of questions. #2 is theoretically slower.
> 
> 
> 
> Quoting Eliezer Broder <[EMAIL PROTECTED]>:
> 
> > 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 Links
> >
> >
> >
> >
> >
> >
> >
> 
> 
> 
> 
> 
> 
> Yahoo! Groups Links
> 
> 
> 
> 
> 
> 
>


[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=12hof7cvv/M=362335.6886445.7839731.1510227/D=groups/S=1705006764:TM/Y=YAHOO/EXP=1123280737/A=2894361/R=0/SIG=13jmebhbo/*http://www.networkforgood.org/topics/education/digitaldivide/?source=YAHOO&cmpgn=GRP&RTP=http://groups.yahoo.com/";>In
 low income neighborhoods, 84% do not own computers. At Network for Good, help 
bridge the Digital Divide!</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