تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
[VB.NET] مشكلة فى زر Login الخاص بشاشة الدخول
#1
ده الكود اللى استخدمته
 Private Sub LoginButton_Click(sender As Object, e As EventArgs) Handles LoginButton.Click
        Try
            Dim con As New SqlConnection("Data source=.;Initial Catalog=ChurchMembership;Integrated Security=True")

            If TextBoxUsername.Text = "" Then
                MsgBox("You Must Enter The Username", MsgBoxStyle.Exclamation, "Error")
            End If
            If TextBoxPassword.Text = "" Then
                MsgBox("You Must Enter The Password", MsgBoxStyle.Exclamation, "Error")
            End If
            Dim Str As String = "select * from Users where Username =" & TextBoxUsername.Text & "and Password=" & TextBoxPassword.Text & ""
            Dim da As New SqlDataAdapter(Str, Con)
            Dim ds As New DataSet
            da.Fill(ds)
            If ds.Tables(0).Rows.Count > 0 Then
                Me.Hide()
                MdiParent.Show()
            End If
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub
وعند التنفيذ تظهر لى رسالة 
Incorrect syntax near 'Password'
الرد }}}
تم الشكر بواسطة:


الردود في هذا الموضوع
مشكلة فى زر Login الخاص بشاشة الدخول - بواسطة Michael Maher - 15-05-18, 11:17 PM


التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم