Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. How can we obtain the currency value from the database table

How can we obtain the currency value from the database table

Scheduled Pinned Locked Moved C#
databasequestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    ATC
    wrote on last edited by
    #1

    I have to get the price (currency) from a database table, but I can not assign double & Decimal variable to it, which define type I should use?

    W 1 Reply Last reply
    0
    • A ATC

      I have to get the price (currency) from a database table, but I can not assign double & Decimal variable to it, which define type I should use?

      W Offline
      W Offline
      Wendelius
      wrote on last edited by
      #2

      If you're using SQL Server use SqlDbType.Money or SqlDbType.SmallMoney.

      The need to optimize rises from a bad design. My articles[^]

      A 1 Reply Last reply
      0
      • W Wendelius

        If you're using SQL Server use SqlDbType.Money or SqlDbType.SmallMoney.

        The need to optimize rises from a bad design. My articles[^]

        A Offline
        A Offline
        ATC
        wrote on last edited by
        #3

        Unfortunately I had MS Access database instead, but when I used VB.net then I defined Decimal type is OK! Also I can not re-define the database differently, because other applications are still using them (VC++) Any new suggestion? Thank

        W 1 Reply Last reply
        0
        • A ATC

          Unfortunately I had MS Access database instead, but when I used VB.net then I defined Decimal type is OK! Also I can not re-define the database differently, because other applications are still using them (VC++) Any new suggestion? Thank

          W Offline
          W Offline
          Wendelius
          wrote on last edited by
          #4

          Could you post the parts of the code that are not working. I don't quite see why decimal wouldn't work. Also are getting an exception. If so, what is it?

          The need to optimize rises from a bad design. My articles[^]

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups