Dear all VB.Net Helpers ,
I have a question in a proj am doin
is it possible to fill a combo from a database(am using acess) and i want in this combo to show two fields of a table in the database
my table is employee and i want to show in the same combo both the first and last name of the employee,is that possible?
Hope To get A response as as soon as possible ...
Thank you
Regards,
Me
n.b:txtreport is the combo name
this is the code am using below :
' Fill the combobox
Dim pDataAdapter As OleDb.OleDbDataAdapter
Dim pDataSet As DataSet
pDataAdapter = New OleDb.OleDbDataAdapter(New OleDb.OleDbCommand( _
"SELECT FirstName,LastName FROM Employees ", mConn))
pDataSet = New DataSet
Try
pDataAdapter.Fill(pDataSet)
Catch eror As Exception
MsgBox(eror.Message)
End Try
txtreport.DataSource = pDataSet.Tables(0)
txtreport.DisplayMember = "FirstName"
I have a question in a proj am doin
is it possible to fill a combo from a database(am using acess) and i want in this combo to show two fields of a table in the database
my table is employee and i want to show in the same combo both the first and last name of the employee,is that possible?
Hope To get A response as as soon as possible ...
Thank you
Regards,
Me
n.b:txtreport is the combo name
this is the code am using below :
' Fill the combobox
Dim pDataAdapter As OleDb.OleDbDataAdapter
Dim pDataSet As DataSet
pDataAdapter = New OleDb.OleDbDataAdapter(New OleDb.OleDbCommand( _
"SELECT FirstName,LastName FROM Employees ", mConn))
pDataSet = New DataSet
Try
pDataAdapter.Fill(pDataSet)
Catch eror As Exception
MsgBox(eror.Message)
End Try
txtreport.DataSource = pDataSet.Tables(0)
txtreport.DisplayMember = "FirstName"