|
-
Aug 26th, 2003, 09:50 AM
#1
Thread Starter
Fanatic Member
pool
Hi,
in a class module, this is how I am retrieving data.
Public Function GetAllCollectionsForParent(ByVal intParentID As Integer) As SqlDataReader
Dim strSQL As String = "CSA_SP_GetAllStrategiesParentCollections"
Dim oCon As SqlConnection
Dim oCmd As SqlCommand
Try
oCon = New SqlConnection(ConnectToDB)
oCmd = New SqlCommand(strSQL, oCon)
With oCmd
.CommandType = CommandType.StoredProcedure
.Parameters.Add("@StrategyParentID", SqlDbType.Int, 4)
.Parameters("@StrategyParentID").Value = intParentID
oCon.Open()
Return .ExecuteReader(CommandBehavior.CloseConnection)
End With
Catch ex As Exception
Throw ex
End Try
End Function
In the form module I then use a datareader to loop through the above records...
After about 300 records i receive an error message saying something about the connection pool may have reached its limit.
Any thoughts?
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|