Groups | Blog | Home
all groups > vb.net > february 2004 >

vb.net : Color Number Storage


Brad
2/4/2004 8:26:05 PM
Hello All

I have run into a bit or frustration. I am trying to save a color into a sql database. I thought that I could just save the result of color.ToArgb but the result I get (-8323200) dosn't work when I use color.fromArgb(-8323200

I figured this would be the best way to save color information into a database but nothing is working. Does anyone have any experiance with this

Thanks for the help
bra
Matthew Hazlett
2/5/2004 12:17:36 AM
Whhat type of field is it defind as in the database? My guess is the field
dosn't support negitive numbers or is not big enough.

[quoted text, click to view]
sql database. I thought that I could just save the result of color.ToArgb
but the result I get (-8323200) dosn't work when I use
color.fromArgb(-8323200)
[quoted text, click to view]

Jay B. Harlow [MVP - Outlook]
2/5/2004 7:54:50 AM
Brad,
Which version of VS.NET (2002 or 2003)?

What specifically do you mean "doesn't work"? You get a different color, you
get an exception what?

What type of field are you using the database, it needs to be a 32bit
integer (or larger).

In a simple test I don't see any problems with Color.ToArgb & Color.FromArgb
to convert to & from an Integer, However I have not tried going to a
database...

Hope this helps
Jay

[quoted text, click to view]
sql database. I thought that I could just save the result of color.ToArgb
but the result I get (-8323200) dosn't work when I use
color.fromArgb(-8323200)
[quoted text, click to view]

AddThis Social Bookmark Button