vendredi 30 janvier 2015

I cant compare a data grid view cell to a textbox.text in visual basic


Dim string1 As String = EmployeeDataGridView.CurrentRow.Cells(7).Value.ToString()
Dim string2 As String = Password_TextBox.Text


If string2 = string1 Then
MessageBox.Show("hello")

Else
MessageBox.Show("string 1= " & string1 & "string 2= " & string2)

End If


I want the message box to display "hello" but only the other messagebox runs with the message "string 1= yes string 2= yes"


so the two strings both equal "yes" so why is the if statement not running the code?


Aucun commentaire:

Enregistrer un commentaire