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

  • SEARCH
  • Home
  • 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 8515477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:09:26+00:00 2026-06-11T05:09:26+00:00

I have several dictionaries i populate from a database here is some sample of

  • 0

I have several dictionaries i populate from a database here is some sample of database
all fileds in DB are represented as strings

PromoStatus         3   Paid
PromoStatus         4   Escrowed
TickTransCode   &H0 Valid cashable ticket
TickTransCode   &H1 Valid restricted promo ticket
TickTransCode   &H2 Valid nonrestricted promo ticket
BIllDenom           0   1
BIllDenom           1   2

here is code i have

Public Shared TickTransCode As New Dictionary(Of Byte, String)()
Public Shared BIllDenom As New Dictionary(Of Byte, Decimal)()
Public Shared PromoStatus As New Dictionary(Of Byte, String)()    
Dim myReader As SqlDataReader = Nothing
Dim myCommand As New SqlCommand("select * from dictionary", myConnection)
myReader = myCommand.ExecuteReader()
While myReader.Read()
    Select Case myReader.GetString(2)
        Case "PromoStatus"
           PromoStatus.Add(Convert.ToByte(myReader.GetString(3)), myReader.GetString(4))
        Case "BillDenom"
           BIllDenom.Add(Convert.ToByte(myReader.GetString(3)), Convert.ToByte(myReader.GetString(4)))
        Case "TickTransCode"
           TickTransCode.Add((myReader.GetString(3)), myReader.GetString(4))
     End Select
End While

the first to cases work fine the 3 case i am not sure the proper conversion so &HA should actually be 10 &HF would be 15 etc. you may ask why i dont just put the actual number in DB but the Hex number is what i get from the comm stream and number the documention uses so i need to keep same so dont have to convert every number when trouble shooting data issues.

here is error i get

Input string was not in a correct format

also is there a better way to do the dictionary from a database, I have far many more dictionaries than in this sample to be populated and i really dont want a table for each one. reason i using DB is so i can add to dictionaries without having to recompile and also to put some additional languages for prompts and messages etc that can load and or change at run timeat run time

  • 1 1 Answer
  • 0 Views
  • 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. Editorial Team
    Editorial Team
    2026-06-11T05:09:28+00:00Added an answer on June 11, 2026 at 5:09 am

    NumberStyles.HexNumber does not allow “&h” or “&H”. However, you can remove them simply:

    Dim s = "&h1A"
    s = s.Replace("&H", "").Replace("&h", "")
    Dim n = Integer.Parse(s, Globalization.NumberStyles.HexNumber)
    Console.WriteLine(n.ToString)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several Delphi programs that maintain connections to a database (some Oracle, some
i have several dictionaries in my program,i have put all those dictionaries in an
I have quite a few dictionaries where the key is a composite of several
I have several resource dictionaries with theme-related data, where I declared styles for particular
I have several TSV files ranging in size from 2MB to 450MB. I need
I have several fields on an Orbeon xform that are populated by a database
I have several <asp:TextBox TextMode=MultiLine> elements on a page. On load, I populate them
I have some issues resolving an algorithm used to find all posible combinations taking
We have several Visual Studio projects, and we would like to: enable/disable some defines
In a plist I have several dictionaries (events, eg. soccer matches) in an array

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.