Dim rows As Int,strPass As String
    Dim a As MSSQL, L As List
    a.setDatabase("192.168.1.2","DBNAME","username","pswd")
    strPass = ModuleEncrypt.RC4(txtPassword.Text, "PUBLIC_KEY")
    L=a.Query("select * from Passwords Where UserName = '" & txtUserName.Text & "' And Password = '" & strPass & "'")
    If L.IsInitialized=False Then
        Msgbox("YOUR CREDENTIALS FAILED TO AUTHENTICATE","PLEASE TRY AGAIN!")
    Else
        If L.Size>0 Then
  
            rows = L.Size
      
            If rows=1 Then
                Msgbox("YOUR CREDENTIALS FAILED TO AUTHENTICATE","PLEASE TRY AGAIN!")
            Else
                IME1.HideKeyboard
                Activity.RemoveAllViews
                MyPhone.SetScreenOrientation(-1)'Release Orientation
                Activity.LoadLayout("SectionChoice")
                FormatSectionChoiceViews
                DoEvents
            End If
        Else
            Msgbox("Sorry, Authentication Failed." & CRLF & "Please Try Again","INVALID USER DETAILS")
        End If
    End If