Super Dave 123
Member
- Joined
- Sep 3, 2008
- Messages
- 19
- Programming Experience
- 1-3
I have created a form with the following textboxes:
- Customer Name
- Address
- Telephone #
- Customer ID
- Postal Code
- Birth Date
This form allows the user to search for records using values entered in the textboxes. Assume a user enters a customer ID and presses the find button. The code written in this problem uses ADO.Net to access data in a MS Access 2007 database. When the program finds the record that matches the entered customer ID, the record will be shown on the form. After this search, assume the user presses the clear button on the form which then causes the Customer ID textbox to clear. After doing this, the user wants to find another record using a different customer ID. After entering the second customer ID and pressing the find buttom, the program shows the same results as the one for the first search. I have not declared a new data adaptor nor have I declared a new dataset for the second query. I'm using the same data adaptor and dataset that was used for the first query but with different search criteria. How can I overcome this problem? That is, how can I use the same data adaptor and dataset for retrieving a record using the same SQL statement but with a different search criteria (i.e. different customer ID value).
Thanks.
- Customer Name
- Address
- Telephone #
- Customer ID
- Postal Code
- Birth Date
This form allows the user to search for records using values entered in the textboxes. Assume a user enters a customer ID and presses the find button. The code written in this problem uses ADO.Net to access data in a MS Access 2007 database. When the program finds the record that matches the entered customer ID, the record will be shown on the form. After this search, assume the user presses the clear button on the form which then causes the Customer ID textbox to clear. After doing this, the user wants to find another record using a different customer ID. After entering the second customer ID and pressing the find buttom, the program shows the same results as the one for the first search. I have not declared a new data adaptor nor have I declared a new dataset for the second query. I'm using the same data adaptor and dataset that was used for the first query but with different search criteria. How can I overcome this problem? That is, how can I use the same data adaptor and dataset for retrieving a record using the same SQL statement but with a different search criteria (i.e. different customer ID value).
Thanks.