T
tshad
I have about 10 dropdownlists that I need to fill when the page loads.
At the moment I am doing the following over and over for each dropdown:
*****************************************************************
Sub GetExperience(sender As Object, e As System.EventArgs)
Dim emailReader As SqlDataReader
trace.warn("inside GetExperience")
Dim ConnectionString as String
=System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_ftso")
Dim objConn as New SqlConnection (ConnectionString)
Dim CommandText as String = "Exec GetExperienceLevel"
Dim objCmd as New SqlCommand(CommandText,objConn)
objConn.Open()
ExperienceLevel.DataSource=objCmd.ExecuteReader
ExperienceLevel.DataTextField= "Description"
ExperienceLevel.DataValueField="EducationLevelID"
ExperienceLevel.databind()
trace.warn("exiting GetZipCodes")
end sub
*******************************************************************
The tables and objects are different for each one.
I was curious if this too inefficient and if there is a better way to do
this. If there were only 1 or 2 I assume this would be fine. But with 10
or so, would the resetting up and the objConn.Open() for each one be
draining on the system?
Thanks,
Tom
At the moment I am doing the following over and over for each dropdown:
*****************************************************************
Sub GetExperience(sender As Object, e As System.EventArgs)
Dim emailReader As SqlDataReader
trace.warn("inside GetExperience")
Dim ConnectionString as String
=System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_ftso")
Dim objConn as New SqlConnection (ConnectionString)
Dim CommandText as String = "Exec GetExperienceLevel"
Dim objCmd as New SqlCommand(CommandText,objConn)
objConn.Open()
ExperienceLevel.DataSource=objCmd.ExecuteReader
ExperienceLevel.DataTextField= "Description"
ExperienceLevel.DataValueField="EducationLevelID"
ExperienceLevel.databind()
trace.warn("exiting GetZipCodes")
end sub
*******************************************************************
The tables and objects are different for each one.
I was curious if this too inefficient and if there is a better way to do
this. If there were only 1 or 2 I assume this would be fine. But with 10
or so, would the resetting up and the objConn.Open() for each one be
draining on the system?
Thanks,
Tom