Public Function fetchActiveProfiles() As List(Of String) Dim lstProfiles As New List(Of String) Dim sqlCmd As String sqlCmd = "" sqlCmd = sqlCmd & " select [System Name],AgencyID" sqlCmd = sqlCmd & " from tblOrgProfile" sqlCmd = sqlCmd & " Where Active = 1" sqlCmd = sqlCmd & " order by [System Name]" Try Using con As New SqlConnection(GetConnectionString) con.Open() Using cmd As New SqlCommand(sqlCmd, con) cmd.CommandType = CommandType.Text Using rs As SqlDataReader = cmd.ExecuteReader() If Not rs.HasRows Then Return lstProfiles End If 'rs.NextResult() While rs.Read lstProfiles.Add(rs.GetString(0)) End While End Using End Using con.Close() End Using Catch ex As Exception Throw New DatabaseConnectionException() End Try Return lstProfiles End Function
Gain unlimited access to on-demand training courses with an Experts Exchange subscription.Get Access
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE
Connect with Certified Experts to gain insight and support on specific technology challenges including: