Re: Save a System.Drawing.Color in the db
- From: "Richard Brunet" <brunetrichard@xxxxxxxxxxx>
- Date: Mon, 6 Jun 2005 16:59:44 -0400
I know Chris, the thing is WHEN can i do this? I recall that i use
OleDbDataAdapter.Update(myTable) where myTable schema has a Color column,
and the database has a corresponding string column (could change for an int
too depending on the solution). I want to avoid doing the conversion on the
client side (within the form code) using Binding.Parse and Format ... I'm
looking for a server-side solution so the server can send to the client a
DataTable containing a System.Drawing.Color column, not an Int32 column
(which would be more natural for the client side...).
Thanks .
"Chris Holland" <ChrisHolland@xxxxxxxxxxxxxxxxxxxxxxxxx> a écrit dans le
message de news:1A4413F5-D6A3-4D0E-91F8-9C5DA58D9A4D@xxxxxxxxxxxxxxxx
> Hi Richard,
>
> You can convert from a Color to an Int32 using Color.ToArgb() and store
the
> int value in the database. To retrive the Color use FromArgb(int32) to
> convert from the int back to a Color
>
> --
> Chris Holland
>
>
> "Richard Brunet" wrote:
>
> > Hi,
> > I have a DataTable that has a Color type DataColumn. I use
> > OleDbDataAdapter.Update(myTable) to update the db. Is there a place(an
> > event?) where i can do a type conversion from Color to string (or int)
so
> > that the value can be saved in the db? What is the preferred way of
> > saving/reading Color DataColumns in the db? The point is the call to
> > OleDbDataAdapter.Update(myTable) appears to be atomic an offers no event
to
> > do such a conversion. Therefore, you end up with a string column in the
db,
> > and an incompatible Color DataColumn in your DataTable ! I'm caught with
> > this.
> >
> > Thanks for any help!
> >
> >
> >
.
- References:
- Save a System.Drawing.Color in the db
- From: Richard Brunet
- RE: Save a System.Drawing.Color in the db
- From: Chris Holland
- Save a System.Drawing.Color in the db
- Prev by Date: How to use Formatter.Schedule() ?
- Next by Date: Re: Windows service Unable to access mapped drives on XP and 2003
- Previous by thread: RE: Save a System.Drawing.Color in the db
- Next by thread: How to return the pointer of int32 in C# .NET?
- Index(es):
Relevant Pages
|
Loading