22-03-21, 05:57 PM
(آخر تعديل لهذه المشاركة : 22-03-21, 05:58 PM {2} بواسطة رضوان الجماعي.)
ممكن حد يساعدني اضفت كل حاجه لكنه يطلعلي انه da.Fill(dt)
Imports System.Data.OleDb
Imports System.Data
Public Class Form1
Public con As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data source=|DataDirectory|\bin\Debug\lapsoft.accdb")
Dim dt As New DataTable
Dim da As New OleDbDataAdapter
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Close()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'LapsoftDataSet.login' table. You can move, or remove it, as needed.
Me.LoginTableAdapter.Fill(Me.LapsoftDataSet.login)
Me.LoginBindingSource.AddNew()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = Nothing Then
MsgBox("يجب عليك ادخال اسم المستخدم", MsgBoxStyle.Information, "تنبيه")
TextBox1.Focus()
Exit Sub
End If
If TextBox2.Text = Nothing Then
MsgBox("يجب عليك ادخال كلمة المرور ", MsgBoxStyle.Information, "تنبيه")
TextBox2.Focus()
Exit Sub
End If
dt.Clear()
da = New OleDbDataAdapter("select * from login where username = '" & TextBox1.Text & "' and pass = '" & TextBox2.Text & "'", con)
da.Fill(dt)
If dt.Rows.Count > 0 Then
Form2.Label1.Text = dt.Rows(0).Item("username")
Form2.Show()
Me.Close()
Else
MsgBox("اسم المستخدم او كلمة المرور غير صحيحة ", MsgBoxStyle.Information, "تنبيه")
End If
End Sub
End Class
Imports System.Data.OleDb
Imports System.Data
Public Class Form1
Public con As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data source=|DataDirectory|\bin\Debug\lapsoft.accdb")
Dim dt As New DataTable
Dim da As New OleDbDataAdapter
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Close()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'LapsoftDataSet.login' table. You can move, or remove it, as needed.
Me.LoginTableAdapter.Fill(Me.LapsoftDataSet.login)
Me.LoginBindingSource.AddNew()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = Nothing Then
MsgBox("يجب عليك ادخال اسم المستخدم", MsgBoxStyle.Information, "تنبيه")
TextBox1.Focus()
Exit Sub
End If
If TextBox2.Text = Nothing Then
MsgBox("يجب عليك ادخال كلمة المرور ", MsgBoxStyle.Information, "تنبيه")
TextBox2.Focus()
Exit Sub
End If
dt.Clear()
da = New OleDbDataAdapter("select * from login where username = '" & TextBox1.Text & "' and pass = '" & TextBox2.Text & "'", con)
da.Fill(dt)
If dt.Rows.Count > 0 Then
Form2.Label1.Text = dt.Rows(0).Item("username")
Form2.Show()
Me.Close()
Else
MsgBox("اسم المستخدم او كلمة المرور غير صحيحة ", MsgBoxStyle.Information, "تنبيه")
End If
End Sub
End Class
اللهم اني قد نذرت نفسي لمساعدت الاخرين فوفقني وكن لي معين
جاهز لمساعدة اي حد يحتاج لمساعدتي
طبيب اعشق البرمجة .