I have a database full of DVD movies that I own. The fields in this database are Title, Plot, Cast, Genre, Book, Page, & Slot. The Book, Page & Slot fields show me where the DVD’s are stored. I am trying to build a process that will list movies to a DataGrid based on any combination of 4 criteria (Title, Cast, Genre, and Rating). The user can use any part of the data in the first 3 fields(ie for Title they could enter only “Lone” and the search function will find any and all movies with “Lone” in the title) The rating field is limited to one of a selection of movie ratings.(NR, G, PG, PG-13, R, X)
I have no problem building a search string with the exception of adding the Row Number of the record in the original dataset. I’ve tried
srchString = "SELECT ROW_NUMBER() OVER(ORDER BY Title),Title, Plot, Cast, Rated, Genre,
Book, Page, Slot FROM DVD_List WHERE "
But I get an error:
Additional information: The expression contains undefined function call ROW_NUMBER().
This was the only function Icoul find to give me a Row Number.
The second part is, the filter to use to get this all in a DataGridView, eerythinI have read says that the Filter command will list AL columns in the database and cannot be limited to just a select few. Any ideas on overcoming this?
srchDataView.RowFilter = srchString