Showing a single record in datagridview from access database vb.net

JohnB

What I have is a small application that has a datagridview and an Access DB. There are 10 records in the database and they all show up in the datagridview when the app is launched. I need to be able to do two things:

  1. I need to be able to enter an id number in a textbox and have JUST that record show in the DGV.
  2. I need to be able to have it show all the records again (using a different click event of course).

I am able to choose the record with this:

Dim row As DataRow
        row = ProductsDataSet.tblProducts.FindByItemNum(txtNumber.Text)

but I am unable to figure out how to show just that record in the DGV. (Let me clarify...I THINK I am choosing the record simply because no exceptions are being thrown).

Any guidance here would be greatly appreciated. Thank you.

John

Greg

An option is to set the dataSource of your dataGridView to the data you'd like to display. Below is an implementation using dataTables.

Class MyForm

Dim dataTableAll, dataTableOneID, As DataTable

Sub show1ID_Click
Dim id As Integer = InputBox("Enter ID")
dataTable2 = dataTable1.Select("[ID] = id").CopyToTable
dataGridView.DataSource = dataTableOneID
End Sub

Sub showAll_Click
dataGridView.DataSource = dataTableAll
End Sub

End Class

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

VB.NET: Cannot display selected data from access database into datagridview

From Dev

Updating an Access Database via a DataGridView Using OLEDB in VB.NET

From Dev

Add a New Record to Microsoft Access Database using VB.Net?

From Dev

Showing only first and single record from database in laravel 5.5

From Dev

How to Fill Data From Database to datagridview and combobox - vb.net

From Dev

Problem in Data display from database using datagridview in vb.net

From Dev

How to Fill Data From Database to datagridview and combobox - vb.net

From Dev

Merge query from datagridview to database not executing sql, vb.net

From Dev

Adding a record in Datagridview Row in Vb.net

From Dev

vb.net datagridview not showing selected row

From Dev

how to fetch next record from ms access table in vb .net

From Dev

Showing data from related tables in single datagridview

From Dev

vb.net Loading Images from Access Database to DataTable?

From Dev

VB.NET:Updating record in Ms Access

From Dev

VB.net .tostring("0.000") from datagridview

From Dev

Access Database VB - Searching a database for most 'RECENT' record

From Dev

Inserting data into database in one record from multiple forms in vb.net

From Dev

How to navigate to next data record from database using data reader? vb.net

From Dev

Show single record from mysql query database

From Dev

How to show array in DataGridView in VB.NET without using Database?

From Dev

how to bind datagridview to database at page load time in vb.net

From Dev

How to show array in DataGridView in VB.NET without using Database?

From Dev

VB.NET display datagridview with SQL Server database

From Dev

VB.NET and Microsoft Access: Old table entries stuck in DataGridView

From Dev

Datagridview SelectedRows index error | Access and VB.NET

From Dev

VB.NET and Access DataBase Trends

From Dev

vb.net Inserting data to access database

From Dev

VB.NET Modify Matching with Access Database

From Dev

How to insert time into access database (VB Net)

Related Related

  1. 1

    VB.NET: Cannot display selected data from access database into datagridview

  2. 2

    Updating an Access Database via a DataGridView Using OLEDB in VB.NET

  3. 3

    Add a New Record to Microsoft Access Database using VB.Net?

  4. 4

    Showing only first and single record from database in laravel 5.5

  5. 5

    How to Fill Data From Database to datagridview and combobox - vb.net

  6. 6

    Problem in Data display from database using datagridview in vb.net

  7. 7

    How to Fill Data From Database to datagridview and combobox - vb.net

  8. 8

    Merge query from datagridview to database not executing sql, vb.net

  9. 9

    Adding a record in Datagridview Row in Vb.net

  10. 10

    vb.net datagridview not showing selected row

  11. 11

    how to fetch next record from ms access table in vb .net

  12. 12

    Showing data from related tables in single datagridview

  13. 13

    vb.net Loading Images from Access Database to DataTable?

  14. 14

    VB.NET:Updating record in Ms Access

  15. 15

    VB.net .tostring("0.000") from datagridview

  16. 16

    Access Database VB - Searching a database for most 'RECENT' record

  17. 17

    Inserting data into database in one record from multiple forms in vb.net

  18. 18

    How to navigate to next data record from database using data reader? vb.net

  19. 19

    Show single record from mysql query database

  20. 20

    How to show array in DataGridView in VB.NET without using Database?

  21. 21

    how to bind datagridview to database at page load time in vb.net

  22. 22

    How to show array in DataGridView in VB.NET without using Database?

  23. 23

    VB.NET display datagridview with SQL Server database

  24. 24

    VB.NET and Microsoft Access: Old table entries stuck in DataGridView

  25. 25

    Datagridview SelectedRows index error | Access and VB.NET

  26. 26

    VB.NET and Access DataBase Trends

  27. 27

    vb.net Inserting data to access database

  28. 28

    VB.NET Modify Matching with Access Database

  29. 29

    How to insert time into access database (VB Net)

HotTag

Archive