السلام عليكم
لقد جربت هذا الكود ولكن يوجد مشكلة
Private MyCONN As New OleDbConnection
Private ConnStr = ("Provider=Microsoft.jet.oleDB.4.0;Data Source=" & Application.StartupPath & "\purchases.mdb;" & "Persist Security Info=False")
Sub FillSupplyOrder()
Try
MyCONN.ConnectionString = ConnStr
Dim OleCommand As New OleDbCommand
Dim OleDataReader As OleDbDataReader
OleCommand.CommandText = "select * from supply where supplyOrder=' & txtsupplyOrder.Text.Trim & '"
OleCommand.Connection = MyCONN
MyCONN.Open()
OleDataReader = OleCommand.ExecuteReader()
If OleDataReader.Read Then
txtSupplyerName.Text = OleDataReader.GetString(1)
txtSupplyDate.Text = OleDataReader.GetString(2)
Else
MsgBox(" هذا الرقم غير موجود")
End If
MyCONN.Close()
OleDataReader.Close()
Catch ex As OleDb.OleDbException
MessageBox.Show(ex.Message)
End Try
End Subبالنسبة لهذا الامر
OleCommand.CommandText = "select * from supply where supplyOrder=' & txtsupplyOrder.Text.Trim & '"
الداتا تايب بتاعته رقم ومع ذلك يعترض وكنت من قبل قد جربت هذا الكود بدلا من السابق
OleCommand.CommandText = "select * from supply where supplyOrder='" & txtsupplyOrder.Text.Trim & "'"
ولكن المشكلة مارالت مطروحة
أرجو الافادة
تحياتى.....