Re: object to a byte[]: revisit

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Pohihihi <noemail@xxxxxxxxxxx> wrote:
> I guess I miss the part of casting as array (?)
>
> you mean
>
> byte[] b = (byte[])row["SomeColName"];

Yup.

> never did this before but surely will try if this works, until now I was
> only doing (byte) and never tried (byte[]). For the return type I am
> positive that it will return byte[] or DBNull in case empty col.

Right. Casting to byte certainly wouldn't work.

--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
.



Relevant Pages

  • Re: Raise event inside a thread
    ... using monitors or a ManualResetEvent. ... Jon Skeet - ... If replying to the group, please do not mail me too ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: get the actual size of a file
    ... saying for certain either way:) ... Jon Skeet - ... If replying to the group, please do not mail me too ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Threading/Locking
    ... Then you stash the data in an ordered list which is then processed by ... Jon Skeet - ... If replying to the group, please do not mail me too ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How to trigger other thread
    ... updates are "seen" or not. ... Jon Skeet - ... If replying to the group, please do not mail me too ... Prev by Date: ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: MemoryStream.Write() Offset cannot be zero
    ... a file - it's just like that, except it all stays in memory. ... Jon Skeet - ... If replying to the group, please do not mail me too ... Prev by Date: ...
    (microsoft.public.dotnet.framework)