string to int to enum

 

Public Enum enuSubject

  None = -1

  Math = 0           

  English = 1            

End Enum


        Dim strSUBJECT = Info.SUBJECT

        Dim intSUBJECT = IIf(IsNumeric(strSUBJECT), strSUBJECT, 0)

        Dim SUBJECT = CType(intSUBJECT, enuSubject)



    Dim SUBJECT = IIf(IsNumeric(RowData.Item(IdxColumnName.SUBJECT.ToString)), RowData.Item(IdxColumnName.SUBJECT.ToString), 0)

CType(CInt(SUBJECT), enuSubject)


留言

熱門文章