こんにちは、2 つの文字列を比較したいのですが、最初は指定されたベースにあり、もう 1 つは から取得されますTextBoxが、結果は常にdo,
Imports System.Data
Imports System.Data.SqlClient
Imports System.Text.RegularExpressions
Public Class Form1
    Private Sub Bcon_Click(sender As Object, e As EventArgs) Handles Bcon.Click
        Dim cnn As SqlConnection = New SqlConnection("Data Source=BANIX;Initial Catalog=mydb;Integrated Security=True;Connect Timeout=15;Encrypt=False;")
        Dim cmd As New SqlCommand("select * from utilisateurs", cnn)
        Dim rd As SqlDataReader
        Dim sr As String = vbNullString
        Try
            cnn.Open()
            rd = cmd.ExecuteReader
            While rd.Read
                sr = rd.GetString(1)
                RTB.AppendText(Environment.NewLine & "DB login = " & sr)
                RTB.AppendText(Environment.NewLine & "TBLogin = " & TBlogin.Text)
                RTB.AppendText(Environment.NewLine & "IsMatch sr:" & Regex.IsMatch(TBlogin.Text, sr))
                RTB.AppendText(Environment.NewLine & "Equals sr : " & String.Equals(TBlogin.Text, sr))
                If (TBlogin.Text = sr) Then
                    RTB.AppendText(Environment.NewLine & "Identique")
                Else
                    RTB.AppendText(Environment.NewLine & "n'est pas Identique")
                End If
            End While
            rd.Close()
        Catch ex As Exception
            RTB.AppendText(Environment.NewLine & " cannot connect !")
        End Try
        cnn.Close()
    End Sub
End Class