For Each row As DataGridItem In dgAssets.Items Dim c As Boolean = DirectCast(row.FindControl("cbSelect"), CheckBox).Checked If (c) Then ptsId = DirectCast(row.FindControl("txtPTSID"), Label).Text ptsIdList.Add(ptsId) End If Next Dim myPtsArr As String() = CType(ptsIdList.ToArray(GetType(String)), String()) If (resultCheck.CheckFailStatus(myPtsArr) = "F") Then Do Stuff End If
Public Function CheckFailStatus(ptsId() As String) As String Dim result As String Dim cs As String = ConfigurationManager.ConnectionStrings("PTS_EConnectionStringDEV").ConnectionString Using con As New SqlConnection(cs) Dim cmd As New SqlCommand("stpr_CheckFailStatus", con) cmd.CommandType = CommandType.StoredProcedure Dim parm As New SqlParameter("@PTSID", ptsId) cmd.Parameters.Add(parm) con.Open() Dim reader As SqlDataReader = cmd.ExecuteReader() While reader.Read() result = (reader("RESV_STATUS").ToString()) End While
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)