Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
Hi,

Now I have spent several hours trying to work something out and googling around and reading forums, but I have not found my answer!

I need to make some kind of "business application" as a project in my school, where I need to keep overview over a company's customers.
I am using Microsoft Visual C# 2010 Express and Access 2010.

My question is:

How do I create a search box/form for an application to search for information in an access-database (.accdb).
I want to use a textbox where I write something from my database, for instance the company's name, and the push the search button. Now it should write all the information there is connected to the company's name, found in the database in a DataGrid.

Maybe it is too big a project, so if anyone got a less complicated search function doing something similar I would also appreciate that.

Thanks in advance!
Posted

1 solution

since security is not an issue for such a project.
i suggest you construct an sql statement using string formatting or concatenation
create a dataset, add a table to it and append data to the datatable for each of the tables you search for and then bind it to your grid.
 
Share this answer
 
Comments
vegazbabz 12-Nov-11 9:20am    
Hello, I appreciate your help/comment, but I am a newbie in programming. So if you could help me a bit with the code, it would be very nice.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900