0

Hi,

I have an access database and connected to vb.net through oledb. Am trying to filter the datagridview based on the combobox selection in the form. The combobox(emp id) is being loaded from the table called Employee. When the user selects an employee id from the combox i want the relevant records of the employee from the other called DATA to be displayed. I tried many methods but couldnot get the result. Can someone help on this please.
Form name-Form1
Combobox-Combobox1
Combobox data-From Table Employee
Datagridview- Datagridview1
Datagrid Source-From table Data

Thanks

2
Contributors
2
Replies
6
Views
2 Years
Discussion Span
Last Post by Krs13
0

Hi

How are you populating the DataGrid? If it is standard OleDb with a DataTable then you can simply issue a new query against the database using the WHERE criteria to filter returned data for the selected employee ID, populate a new DataTable and then bind that DataTable to the DataGrid.

Alternatively, you can issue SELECT statements against a DataTable to filter for data that you want or use a DataView.

If you show us the code that you currently have, it would be easier to then offer a suitable solution.

0

hi, thanks for the reply. Will try with your suggestion with WHERE criteria and make an attempt.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.