G
Guest
I have a vb.NET solution with a Windows Application project that contains my user interface and a Class Library project that contains (among other things) a class I call DataAccessComponent. This class inherits from System.ComponentModel.Component and contains a single SQLConnection object and a bunch of SQLDataAdapter object which reference it. It also exposes 2 methods per SQLDataAdapter object that all look more or less the same. For example
Public Function GetOrganizations(
Optional ByVal anOrganizationID As Object = Nothing) As dsNutme
Dim organizations As New dsNutme
organizations.EnforceConstraints = Fals
If Not anOrganizationID Is Nothing The
SQLDAtblOrganization.SelectCommand.Parameters("@OrganizationID").Value = CType(anOrganizationID, Long
Els
SQLDAtblOrganization.SelectCommand.Parameters("@OrganizationID").Value = System.DBNull.Valu
End I
SQLDAtblOrganization.Fill(organizations
Return organization
End Functio
Public Function UpdateOrganizations(ByVal organizationChanges
As dsNutmeg) As dsNutme
If Not (organizationChanges Is Nothing) The
SQLDAtblOrganization.Update(organizationChanges
Return organizationChange
Els
Return Nothin
End I
End Functio
My question (and I DO have one), is this: why, after several "get" calls, for exampl
Private Sub GetDat
dim mDAC as New DataAccessComponen
dim ds as new dsNutme
ds.Merge(mDAC.GetOrganizations()
' Do something with the data
End Su
, am I suddenly getting a timout exception with the advice that it might have somtehing to do with exceeding the available connections in my connection pool? I BELIEVED that I was just repeatedly using the same connection. Is this not the case? Am I not releasing connection resources properly? How SHOULD I go about doing what I'm trying to do
Thanks
Pa
Public Function GetOrganizations(
Optional ByVal anOrganizationID As Object = Nothing) As dsNutme
Dim organizations As New dsNutme
organizations.EnforceConstraints = Fals
If Not anOrganizationID Is Nothing The
SQLDAtblOrganization.SelectCommand.Parameters("@OrganizationID").Value = CType(anOrganizationID, Long
Els
SQLDAtblOrganization.SelectCommand.Parameters("@OrganizationID").Value = System.DBNull.Valu
End I
SQLDAtblOrganization.Fill(organizations
Return organization
End Functio
Public Function UpdateOrganizations(ByVal organizationChanges
As dsNutmeg) As dsNutme
If Not (organizationChanges Is Nothing) The
SQLDAtblOrganization.Update(organizationChanges
Return organizationChange
Els
Return Nothin
End I
End Functio
My question (and I DO have one), is this: why, after several "get" calls, for exampl
Private Sub GetDat
dim mDAC as New DataAccessComponen
dim ds as new dsNutme
ds.Merge(mDAC.GetOrganizations()
' Do something with the data
End Su
, am I suddenly getting a timout exception with the advice that it might have somtehing to do with exceeding the available connections in my connection pool? I BELIEVED that I was just repeatedly using the same connection. Is this not the case? Am I not releasing connection resources properly? How SHOULD I go about doing what I'm trying to do
Thanks
Pa