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
  1. Home
  2. Database & SysAdmin
  3. Database
  4. best way to save System.Color?

best way to save System.Color?

Scheduled Pinned Locked Moved Database
csharpmysqlquestion
4 Posts 4 Posters 2 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.
  • J Offline
    J Offline
    Jassim Rahma
    wrote on last edited by
    #1

    I am using C# with MySQL.. I want to know what's the best way to save the System.Color in mySQL?

    G 1 Reply Last reply
    0
    • J Jassim Rahma

      I am using C# with MySQL.. I want to know what's the best way to save the System.Color in mySQL?

      G Offline
      G Offline
      Goutam Patra
      wrote on last edited by
      #2

      Try saving as argb

      color.Red.ToArgb().ToString

      or in HEX

      color.Red.ToArgb().ToString ( "X8" )

      Here [^] is a good example of serializing color. Take a look at the PIEBALDconsult's 2nd reply. Although the original thread is about returning color from webservice but still you could get an idea about it. I loved that post

      L P 2 Replies Last reply
      0
      • G Goutam Patra

        Try saving as argb

        color.Red.ToArgb().ToString

        or in HEX

        color.Red.ToArgb().ToString ( "X8" )

        Here [^] is a good example of serializing color. Take a look at the PIEBALDconsult's 2nd reply. Although the original thread is about returning color from webservice but still you could get an idea about it. I loved that post

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        yeah, I liked that thread too. I would however have preferred System.Color to serialize just like a simple integer all by itself! :)

        Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

        Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

        1 Reply Last reply
        0
        • G Goutam Patra

          Try saving as argb

          color.Red.ToArgb().ToString

          or in HEX

          color.Red.ToArgb().ToString ( "X8" )

          Here [^] is a good example of serializing color. Take a look at the PIEBALDconsult's 2nd reply. Although the original thread is about returning color from webservice but still you could get an idea about it. I loved that post

          P Offline
          P Offline
          PIEBALDconsult
          wrote on last edited by
          #4

          Excellent answer! I was about to same the same thing.

          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