Click here to Skip to main content
15,906,816 members
Home / Discussions / C#
   

C#

 
AnswerRe: (C#) Is there something like GetObjectInstanceByName("myObj1")?? Pin
Christian Graus24-Feb-08 19:59
protectorChristian Graus24-Feb-08 19:59 
GeneralRe: (C#) Is there something like GetObjectInstanceByName("myObj1")?? Pin
zeopyrix24-Feb-08 20:06
zeopyrix24-Feb-08 20:06 
GeneralRe: (C#) Is there something like GetObjectInstanceByName("myObj1")?? Pin
Christian Graus24-Feb-08 20:14
protectorChristian Graus24-Feb-08 20:14 
Questionproblem while retriving image from database. [modified] Pin
avvaru.murali24-Feb-08 19:24
avvaru.murali24-Feb-08 19:24 
GeneralRe: problem while image from database. Pin
Christian Graus24-Feb-08 19:32
protectorChristian Graus24-Feb-08 19:32 
QuestionRe: problem while retrving image from database. Pin
avvaru.murali24-Feb-08 19:40
avvaru.murali24-Feb-08 19:40 
GeneralRe: problem while retrving image from database. Pin
Christian Graus24-Feb-08 20:00
protectorChristian Graus24-Feb-08 20:00 
AnswerRe: problem while image from database. Pin
zeopyrix24-Feb-08 19:39
zeopyrix24-Feb-08 19:39 
Try using Image instead of Bitmap.
Are you sure that the photo field type is BLOB (binary)?

I have no idea of what happens here, but I have some experience with Firebird in C# (sourceforge.net/projects/pokelib) and I wrote some functions for image conversion:

<br />
public static byte[] FileToBytes(string filePath)<br />
        {<br />
            FileStream fs;<br />
            try<br />
            {<br />
                fs = new FileStream(filePath, FileMode.Open, FileAccess.Read);<br />
            }<br />
            catch (IOException)<br />
            {<br />
                return null;<br />
            }<br />
<br />
            // Create a byte array of file stream length<br />
            byte[] fileData = new byte[fs.Length];<br />
<br />
            //Read block of bytes from stream into the byte array<br />
            fs.Read(fileData, 0, System.Convert.ToInt32(fs.Length));<br />
<br />
            //Close the File Stream<br />
            fs.Close();<br />
            return fileData;<br />
        }<br />
<br />
public static Image FileToImage(string imagePath)<br />
        {<br />
            FileStream fs;<br />
            try<br />
            {<br />
                fs = new FileStream(imagePath, FileMode.Open, FileAccess.Read);<br />
            }<br />
            catch (IOException)<br />
            {<br />
                return null;<br />
            }<br />
<br />
            // Create a byte array of file stream length<br />
            byte[] imageData = new byte[fs.Length];<br />
<br />
            //Read block of bytes from stream into the byte array<br />
            fs.Read(imageData, 0, System.Convert.ToInt32(fs.Length));<br />
<br />
            //Close the File Stream<br />
            fs.Close();<br />
            MemoryStream ms = new MemoryStream(imageData);<br />
            return Image.FromStream(ms);<br />
        }<br />
<br />
        public static byte[] ImageToBytes(Image imageIn)<br />
        {<br />
            MemoryStream ms = new MemoryStream();<br />
            imageIn.Save(ms, imageIn.RawFormat);<br />
            return ms.ToArray();<br />
        }<br />
<br />
        public static Image BytesToImage(byte[] byteArrayIn)<br />
        {<br />
            MemoryStream ms = new MemoryStream(byteArrayIn);<br />
            Image returnImage = Image.FromStream(ms);<br />
            return returnImage;<br />
        }

GeneralRe: problem while retriving image from database. Pin
Giorgi Dalakishvili24-Feb-08 20:18
mentorGiorgi Dalakishvili24-Feb-08 20:18 
GeneralExecuting SSis package from C# Pin
tasumisra24-Feb-08 19:18
tasumisra24-Feb-08 19:18 
Questionindeterminate progress bar Pin
veerbala24-Feb-08 18:57
veerbala24-Feb-08 18:57 
GeneralRe: indeterminate progress bar Pin
Christian Graus24-Feb-08 19:08
protectorChristian Graus24-Feb-08 19:08 
QuestionUnique random numbers Pin
D i x y24-Feb-08 18:55
D i x y24-Feb-08 18:55 
GeneralRe: Unique random numbers Pin
Christian Graus24-Feb-08 19:07
protectorChristian Graus24-Feb-08 19:07 
GeneralRe: Unique random numbers Pin
D i x y24-Feb-08 19:52
D i x y24-Feb-08 19:52 
GeneralRe: Unique random numbers Pin
Christian Graus24-Feb-08 20:16
protectorChristian Graus24-Feb-08 20:16 
GeneralHold the timer tick event before processing Pin
CodingLover24-Feb-08 18:26
CodingLover24-Feb-08 18:26 
GeneralRe: Hold the timer tick event before processing Pin
Christian Graus24-Feb-08 18:29
protectorChristian Graus24-Feb-08 18:29 
GeneralRe: Hold the timer tick event before processing Pin
CodingLover24-Feb-08 18:46
CodingLover24-Feb-08 18:46 
GeneralRe: Hold the timer tick event before processing Pin
Christian Graus24-Feb-08 19:04
protectorChristian Graus24-Feb-08 19:04 
GeneralRe: Hold the timer tick event before processing Pin
CodingLover24-Feb-08 19:11
CodingLover24-Feb-08 19:11 
Generalwindows TO vista!! Pin
rowdy_vc++24-Feb-08 18:01
rowdy_vc++24-Feb-08 18:01 
GeneralRe: windows TO vista!! Pin
Christian Graus24-Feb-08 18:12
protectorChristian Graus24-Feb-08 18:12 
GeneralRe: windows TO vista!! Pin
rowdy_vc++24-Feb-08 18:41
rowdy_vc++24-Feb-08 18:41 
GeneralRe: windows TO vista!! Pin
Christian Graus24-Feb-08 18:43
protectorChristian Graus24-Feb-08 18:43 

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

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