Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / ADO.NET / March 2004

Tip: Looking for answers? Try searching our database.

Store Byte Array as DataColumn?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
localhost - 13 Mar 2004 04:53 GMT
Is it possible to store a byte[] array as a type for a DataColumn?  I
was thinking of a generic way to store *anything* in a DataColumn
without seriously typing it, then I can pass the DataSet that contains
it anywhere.

If that is not possible, can I just use an object as a DataColumn
type?

Thanks.
Cor - 13 Mar 2004 08:22 GMT
Hi,

> Is it possible to store a byte[] array as a type for a DataColumn?  I
> was thinking of a generic way to store *anything* in a DataColumn
> without seriously typing it, then I can pass the DataSet that contains
> it anywhere.

I see no problem, so you would have to explain something more.
(It is somethimes called a blob field).
You have of course to define it using the fill. "select" or with gettype.

Cor

> If that is not possible, can I just use an object as a DataColumn
> type?
>
> Thanks.
Gleb Holodov - 15 Mar 2004 13:11 GMT
Yes, you can. Even more, you can define such a column in XSD and then build
a strongly-typed dataset, which respects your custom type. For example,
that's how the XSD designer makes Guid columns:

<xs:element name="StereotypeID" type="xs:string" minOccurs="0"
msdata:DataType="System.Guid, mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" />

You can specify either System.Object or even your own class as a datatype
for a column. Don't forget to place it into GAC< btw.

Hope, that helps,

Gleb.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.