L
Lal
Hello,
I am using VB.net & sql2000 for developing some s/w. I am open the
connection and close that after using. but after continuous using the
following error is coming
how can I avoid this error please help me..
I am sending the code also
Publicc Sub FillCombo(ByVal SQLCombo As String, ByVal CBox As
Windows.Forms.ComboBox, ByVal ConString As String)
Dim CON As New SqlClient.SqlConnection()
CON.ConnectionString = ConString
CON.Open()
Dim COM As SqlClient.SqlCommand
COM = New SqlClient.SqlCommand()
COM.Connection = CON
COM.CommandType = CommandType.Text
COM.CommandText = SQLCombo
Dim DR As SqlClient.SqlDataReader
DR = COM.ExecuteReader()
CBox.Items.Clear()
CBox.Items.Add("")
CBox.DropDownStyle = Windows.Forms.ComboBoxStyle.DropDownList
While (DR.Read())
CBox.Items.Add(DR(0))
End While
CBox.SelectedIndex = 0
DR.Close()
CON.Close()
End Sub
This is how we are calling the functions.
SQL = "SELECT Country FROM CountryMaster ORDER BY Country"
Dim DB As New Scriptings.Databases()
DB.FillCombo(SQL, cboCountry, ConnectionString & 1)
DB = Nothing
ERROR IS
An unhandled exception of type 'System.InvalidOperationException' occurred
in system.data.dll
Additional information: Timeout expired. The timeout period elapsed prior
to obtaining a connection from the pool. This may have occurred because all
pooled connections were in use and max pool size was reached.
Regards
Lal
I am using VB.net & sql2000 for developing some s/w. I am open the
connection and close that after using. but after continuous using the
following error is coming
how can I avoid this error please help me..
I am sending the code also
Publicc Sub FillCombo(ByVal SQLCombo As String, ByVal CBox As
Windows.Forms.ComboBox, ByVal ConString As String)
Dim CON As New SqlClient.SqlConnection()
CON.ConnectionString = ConString
CON.Open()
Dim COM As SqlClient.SqlCommand
COM = New SqlClient.SqlCommand()
COM.Connection = CON
COM.CommandType = CommandType.Text
COM.CommandText = SQLCombo
Dim DR As SqlClient.SqlDataReader
DR = COM.ExecuteReader()
CBox.Items.Clear()
CBox.Items.Add("")
CBox.DropDownStyle = Windows.Forms.ComboBoxStyle.DropDownList
While (DR.Read())
CBox.Items.Add(DR(0))
End While
CBox.SelectedIndex = 0
DR.Close()
CON.Close()
End Sub
This is how we are calling the functions.
SQL = "SELECT Country FROM CountryMaster ORDER BY Country"
Dim DB As New Scriptings.Databases()
DB.FillCombo(SQL, cboCountry, ConnectionString & 1)
DB = Nothing
ERROR IS
An unhandled exception of type 'System.InvalidOperationException' occurred
in system.data.dll
Additional information: Timeout expired. The timeout period elapsed prior
to obtaining a connection from the pool. This may have occurred because all
pooled connections were in use and max pool size was reached.
Regards
Lal