24-11-18, 03:37 PM
(آخر تعديل لهذه المشاركة : 24-11-18, 03:38 PM {2} بواسطة Rabeea Qbaha.)
PHP كود :
Sub fill_comb()
combobox1.Items.Clear()
Dim query As String
Dim command As OleDbCommand
Dim reader As OleDbDataReader
'فحص الاتصال بقاعدة البيانات
If Conn.State = ConnectionState.Closed Then
Conn.Open()
End If
query = "SELECT [catName] FROM [your_table] Where quantity = 0"
command = New OleDbCommand(query, Conn)
reader = command.ExecuteReader()
If reader.HasRows Then
While reader.Read()
combobox1.Items.Add(reader(0))
End While
End If
reader.Close()
Conn.Close()
End Sub
