Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 62683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:30:51+00:00 2026-05-10T18:30:51+00:00

In my database I have tables that define types for example Table: Publication Types

  • 0

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

  1. call the function with two integers

    countPublications(authorID, 1)

  2. setup an enum so that I can write

    countPublications(authorID, pubType.Article)

    or

  3. 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

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T18:30:52+00:00Added an answer on May 10, 2026 at 6:30 pm

    if publication types are essentially static, enums are fine

    there is arguably little difference between embedding

    inner join lookuptable lt on lt.id = (int)myenum.sometype  

    in a query and adding

    inner join lookuptable lt on lt.name = 'somehardcodeddescription' 

    they’re both embedded constants, the former just has a well-defined type behind it

    alternately you could use

    inner join lookuptable lt on lt.name = myenum.sometype.ToString 

    i prefer the former

    if, on the other hand, new lookup types may be added after the code is deployed, then an enum will quickly become outdated;

    but if there is core set of static enum values that the code needs and the rest don’t matter then the former solution is still fine

    as usual, ‘it depends’ 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 93k
  • Answers 93k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Found it, thanks me :D CellStyle currencyCellStyle=workbook.createCellStyle(); currencyCellStyle.setDataFormat(format.getFormat("$#,##0.00;[Red]($#,##0.00)")); May 11, 2026 at 6:39 pm
  • Editorial Team
    Editorial Team added an answer Yes I got the answer.Here it is iTblCart.Attributes.Add("Class", "clsTradeInCart"); and… May 11, 2026 at 6:39 pm
  • Editorial Team
    Editorial Team added an answer Instead of immediately pushing messages to the DB after taking… May 11, 2026 at 6:39 pm

Related Questions

I asked this question a while back but now I'm looking to implement an
I just started to play with the entity framework, so I decided to connect
I have to write a component that re-creates SQL Server tables (structure and data)
I'm implementing 'check' constraints that simply call a CLR function for each constrained column.

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.