Searching an access file

cmcrae

Member
Joined
Jan 21, 2003
Messages
10
I am attempting to search a microsoft access file using a vb.net program that I wrote. I want to search a column in one of the tables in the database based on what radiobutton was selected.
the tables names are Movies, Books, and Cds. The columns are Title, AuthorArtistStars, Genre, ISBN, Barcode, and a few other columns.
 
What kind of help are you looking for? With the SQL statement, setting up a DataSet or Datagrid?

What kind of controls are you planning on using?
 
help with searching.

I am trying to populate the listbox with the title of the item that matches the search critera. For Ex. let say I am searching the movies that I own for all the movies that have a rating of R. Inside of my database is 3 different tables one for movies, books and cds. All of the tables have similar fields like title, AuthorArtistStars, genre, type, status, discription, etc.

I want to be able to search each one of those columns for a part of the string that is contained in the field.
 
I dont think you really understand Robbys question. Since no one is going to write the program for you, we just need to know if you need help with:
A. Writing the SQL to retreive the right records
B. Setting up a database connection (connection string, the objects involved, etc.)
C. Binding the listbox to the DataSet or results from a DataReader

There are a number of steps to connect to a database and show the results - were not sure of your level of experience and no one wants to write up 200 lines of sample code if you only need 3 :)

-Nerseus
 
more questions

I am not tryingto ask you to write a program for me I have written most of it already. Ihave the program populating a listbox and retrieving records and a bunch of other things. What Iam trying to so now is write a search routine that will search the specified table in the access file and then look at the text in the column that you specified for any text that matches your string and then populate the listbox with the title of that item that matches the search string .
 
There are a couple of ways to get what you want. You could run a query to do the filtering in a WHERE clause. You could also use the DataTables Select method, which returns an array of DataRow objects which you could loop through and add items to the Listbox. Or, you could create a DataView with a filter and bind the ListBox to the DataView.

Deciding on an option depends on where you want to filter (in the database or in C#/VB code), how often you want to filter (performance considerations), and whether youre already bringing down the whole table that will be filtered or not.

-Nerseus
 
my search

What I am searching on depends on the radio button that they select and the text in the text box.
The radio buttons are
title, genre, ISBN,Barcode,author/artist/stars

the radio button signifies the column that you will search all the records for the designated text for.

the text can be anything.
 
Back
Top