.NET and SQL: General network error:

D

deena

Hello

The following code generates an error on the Fill method, the first time it executes and runs successfully thereafter. It does this exactly the same every time. I know know it has something to do with pooling but what? I've set the max pool size to an astronomical 7500 as suggested on a thread on a forum but to no avail :(
The connection is created before this code is executed:

daClearance.SelectCommand = New SqlCommand("ProcGetBookingsByVisitorIDDate", cnnClearance)

daClearance.SelectCommand.CommandType = CommandType.StoredProcedure

Dim paramVisitorIDNo As New SqlParameter("@strVisitorIDNo", SqlDbType.VarChar, 13)

Dim paramVisitEndDate As New SqlParameter("@dteVisitEndDate",

SqlDbType.DateTime)

daClearance.SelectCommand.Parameters.Add(paramVisitorIDNo)

daClearance.SelectCommand.Parameters.Add(paramVisitEndDate)

paramVisitorIDNo.Value = strVisitorIDNo

paramVisitEndDate.Value = dteVisitEndDate

cnnClearance.Open()

daClearance.Fill(dsDetails)

daClearance.SelectCommand = New SqlCommand("ProcGetBookingsByVisitorIDDate", cnnClearance)

daClearance.SelectCommand.CommandType = CommandType.StoredProcedure

Dim paramVisitorIDNo As New SqlParameter("@strVisitorIDNo", SqlDbType.VarChar, 13)

Dim paramVisitEndDate As New SqlParameter("@dteVisitEndDate", SqlDbType.DateTime)

daClearance.SelectCommand.Parameters.Add(paramVisitorIDNo)

daClearance.SelectCommand.Parameters.Add(paramVisitEndDate)

paramVisitorIDNo.Value = strVisitorIDNo

paramVisitEndDate.Value = dteVisitEndDate

cnnClearance.Open()

daClearance.Fill(dsDetails)
 
M

Michelle

Hi Deena,

Are you disposing of the data adapter, connection, etc.? I dont see it
in the code snippet you provided.

take care,
Michelle
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top