D
David C
I have the code below that I use to fill a DropDownList control. I would
like to do something different when it returns more than 1 record. Can I do
this here or back at the code where I call this class function? Thanks.
David
Public Shared Function GetStaffPrograms(ByVal intStaffID As Int32) As
SqlDataReader
Dim conData As SqlConnection = New
SqlConnection(ConfigurationManager.ConnectionStrings("CoreConnectionString").ConnectionString)
conData.Open()
Dim strSQL As String
strSQL = "SELECT ProgramID, ProgramName" & _
" FROM dbo.vw_StaffPrograms" & _
" WHERE StaffID = " & intStaffID.ToString
Dim cmdSel As SqlCommand = New SqlCommand(strSQL, conData)
Dim dtr As SqlDataReader = cmdSel.ExecuteReader()
Return dtr
End Function
like to do something different when it returns more than 1 record. Can I do
this here or back at the code where I call this class function? Thanks.
David
Public Shared Function GetStaffPrograms(ByVal intStaffID As Int32) As
SqlDataReader
Dim conData As SqlConnection = New
SqlConnection(ConfigurationManager.ConnectionStrings("CoreConnectionString").ConnectionString)
conData.Open()
Dim strSQL As String
strSQL = "SELECT ProgramID, ProgramName" & _
" FROM dbo.vw_StaffPrograms" & _
" WHERE StaffID = " & intStaffID.ToString
Dim cmdSel As SqlCommand = New SqlCommand(strSQL, conData)
Dim dtr As SqlDataReader = cmdSel.ExecuteReader()
Return dtr
End Function