We help IT Professionals succeed at work.
Get Started

Image data type in C#

Aquarus
Aquarus asked
on
540 Views
Last Modified: 2012-05-12
In DataLayer of my project I use the following template to pass the recordset data from SP to the Apllication:
[DataContractAttribute]
        public class ClassDetail
        {
            public ClassDetail(IR_USP_SPResult detail)
            {
                this.PBT = detail.PBT;
            }

            [DataMember]
            private string  PBT  { get; set; }
        }

DataMember define the fieldname datatype from the Select statement of the Storeprocedure  with the name IR_USP_SPResult .

I have to create something similar for the select statement of the stored procedure that returns only one field from the table and the datatype of this field is image.

I have already tried
using System.Drawing at the top of my project and this addition allowed me to do the part of the template like this:
 [DataMember]
            private Image  PBT  { get; set; }

But on the step where I am assigning the outside data to the internal:
public ClassDetail(IR_USP_SPResult detail)
            {
                this.PBT = detail.PBT;
            }
I see the red line under detail.PBT and it says that I cannot assign image type to the binary type. What am I doing wrong?
Comment
Watch Question
Sr. Architect
Commented:
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE