Click here to Skip to main content
Licence 
First Posted 17 Jun 2004
Views 73,574
Downloads 1,151
Bookmarked 19 times

Object ByteArray Converter

this dll help users to convert between any object and byte array which will be very useful when using to insert objects into a DataBase
12 votes, 54.5%
1
1 vote, 4.5%
2

3
2 votes, 9.1%
4
7 votes, 31.8%
5
2.52/5 - 22 votes
μ 2.52, σa 3.31 [?]

Introduction

this dll help users to convert between any object and byte array which will be very useful when using to insert objects into a DataBase.(specialy images)

it contain two main methods

ObjectToByteArray:

       which accept an object and return array of bytes .

ByteArrayToObject:

      which accept an array of bytes and return object.

why I make this dll?

I need in a project on automatic exam system in my work (Scientific calculation Center,Mansoura University,Egypt) to insert into database an custum object of exam data.

I'm sure that I can find a solution to this problem by add Exam Details table to my dataBase

but I hope to  use the first strategy ,So I make it.

keywords

Database,converter,image,byte array

      

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Tamer Ahmed Farrag



Egypt Egypt

Member


Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionProblem while converting PinmemberMuneswar23:18 3 Oct '07  
Hi,
 
I tried to use the function ByteArrayToObject and it is returning null object. I tried to debug the code and found that the statement return formatter.Deserialize(stream); is throwing the exception called "End of Stream encountered before parsing was completed." and so returning the null object.
 
Below is the code which calls the function.
 
Byte[] ar = new Byte[3]{1,2,3};
Object o1;
o1 = ObjectByteArrayConverter.ByteArrayToObject(ar);
 
Please let me know the problem which would be a great help.
 
Thanks in advance,

 
Muneswar Rao. G
Generalproblem with some objects Pinmemberjag_Dalton3:00 22 Feb '07  
GeneralRe: problem with some objects PinmemberDrPhilz2:55 28 Jun '07  
GeneralHuge problem with the methods PinmemberKasracer2:38 26 Jan '06  
GeneralRe: Huge problem with the methods Pinmemberjigar_dotnet3:13 4 Apr '07  
QuestionConvert from object to byte array problem Pinmemberanalyzer210:48 19 Jan '06  
AnswerRe: Convert from object to byte array problem PinmemberKasracer2:40 26 Jan '06  
GeneralRe: Convert from object to byte array problem Pinmemberanalyzer22:55 26 Jan '06  
GeneralRe: Convert from object to byte array problem PinmemberKasracer0:37 31 Jan '06  
GeneralRe: Convert from object to byte array problem Pinmemberanalyzer21:25 31 Jan '06  
GeneralRe: Convert from object to byte array problem Pinmemberdonjefe15:54 3 Aug '06  
Generalnice one! PinmemberCodeGimp0:23 27 Jun '05  
QuestionArticle justified? Pinmemberjmw3:16 18 Jun '04  
AnswerRe: Article justified? PinmemberTamer Ahmed Farrag3:47 18 Jun '04  
GeneralI update the article PinmemberTamer Ahmed Farrag0:54 18 Jun '04  
QuestionWhy this way? Pinmembermav.northwind21:19 17 Jun '04  
AnswerRe: Why this way? PinmemberTamer Ahmed Farrag22:42 17 Jun '04  
GeneralRe: Why this way? Pinmembermav.northwind23:08 17 Jun '04  
GeneralRe: Why this way? Pinmemberjmw3:11 18 Jun '04  
GeneralRe: Why this way? PinsussMihies4:28 19 Jun '04  
GeneralRe: Why this way? Pinmemberjmw5:16 19 Jun '04  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web02 | 2.5.120210.1 | Last Updated 18 Jun 2004
Article Copyright 2004 by Tamer Ahmed Farrag
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid