08-08-20, 11:39 PM (آخر تعديل لهذه المشاركة : 08-08-20, 11:40 PM {2} بواسطة عمور2016.)
PHP كود :
Dim query As String Dim command As OleDbCommand Dim reader As OleDbDataReader
'فحص الاتصال بقاعدة البيانات If con.State = ConnectionState.Closed Then con.Open() End If query = "SELECT dep_name FROM [department]" command = New OleDbCommand(query, con) reader = command.ExecuteReader() If reader.HasRows Then While reader.Read() ComboBox1.Items.Add(reader(0)) 'Label2.Text = "تمت الاضافة" End While End If reader.Close() con.Close()
Dim query As String Dim command As OleDbCommand Dim reader As OleDbDataReader
'فحص الاتصال بقاعدة البيانات If con.State = ConnectionState.Closed Then con.Open() End If query = "SELECT dep_name FROM [department]" command = New OleDbCommand(query, con) reader = command.ExecuteReader() If reader.HasRows Then While reader.Read() ComboBox1.Items.Add(reader(0)) 'Label2.Text = "تمت الاضافة" End While End If reader.Close() con.Close()
هذا الكود يشمل الكومبو فقط والليست بوكس
شوف اي كود من عندك
المتغير buttons هو المصفوفه
PHP كود :
dim buttons as button()={button1,button2,button3}
Dim query As String Dim command As OleDbCommand Dim reader As OleDbDataReader
'فحص الاتصال بقاعدة البيانات If con.State = ConnectionState.Closed Then con.Open() End If query = "SELECT dep_name FROM [department]" command = New OleDbCommand(query, con) reader = command.ExecuteReader() If reader.HasRows Then dim i=0 While reader.Read() 'ComboBox1.Items.Add(reader(0)) 'Label2.Text = "تمت الاضافة" buttons(i).text=reader(0) i=i+1 if i=buttons.count then exit while End While End If reader.Close() con.Close()