In my database I have tables that define types for example
Table: Publication Types
ID | Type ---------- 1 | Article 2 | Abstract 3 | Book ....
Which is related through the ID key to a publication tables which has the field TypeID.
I then create a PublicationTable data table my .NET application which I want to filter based on the publication type. For example the following function gives me the number of publications for a specific author and publication type.
Public Function countPublications(ByVal authorID As Integer, _ ByVal publicationType As Integer) As Integer Dim authPubs As New PublicationsDataSet.tblPublicationsDataTable authPubs = Me.getAuthorsPublications(authorID) Dim dv As New DataView(authPubs) dv.RowFilter = "status='published' AND type='" + _ publicationType.ToString + "'" Return dv.Count End Function
To call this function to get a count of articles by an author of a specific type, I could
call the function with two integers
countPublications(authorID, 1)
setup an enum so that I can write
countPublications(authorID, pubType.Article)
or
somehow use the publication type table to filter the publication data set but I haven't got my head around how to do this.
What other approaches should I consider.
Thanks