how to add image in form in c#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rakesh005
    New Member
    • Apr 2010
    • 6

    #1

    how to add image in form in c#

    i want to save the employe image with his data in the database
    so i want to know how to add image in form and to save in database
    please send me the codes
    thanku
  • Dheeraj Joshi
    Recognized Expert Top Contributor
    • Jul 2009
    • 1129

    #2
    You can use PictureBox.

    Code:
    private PictureBox picBox = new PictureBox();
    picBox.size = //Size
    picBox.Image = new Bitmap("your img");
    //Other properties of picture box
    Regards
    Dheeraj Joshi

    Comment

    • rakesh005
      New Member
      • Apr 2010
      • 6

      #3
      i want to store it in the database also
      for that what to do?

      Comment

      • Dheeraj Joshi
        Recognized Expert Top Contributor
        • Jul 2009
        • 1129

        #4
        Convert the image to byte array and save it in database.

        Regards
        Dheeraj Joshi

        Comment

        • tlhintoq
          Recognized Expert Specialist
          • Mar 2008
          • 3532

          #5
          Originally posted by Original Poster
          Can anybody send me code to [...]
          The Bytes volunteers are not here to write your code for you. This is not a free homework service.
          Bytes is very much a "Give me a fish I eat for a day. Teach me to fish I eat for a lifetime" kind of place. Just giving you the code doesn't help you learn near as effectively as good old-fashioned trial and error.

          Please research your problem before posting your question.
          A great place start your research is the MSDN library. This library is a bunch of articles and documentation provided by Microsoft about anything to do with .NET development. I recommend that you bookmark the resource for your future reference.

          After you research, do some experimenting. Then if your trials aren't doing what you expect, post the code and relevant messages/errors and we'll see what we can do to point you in the right direction for making it work.

          Try hitting Google with terms of your programming language and primary terms of what you want to do. For example "C# custom events" or "VB datagrid Excel". I've found this to be a very effective tool.
          Please visit the Posting Guidelines for tips on how to ask questions to get the best help.

          Comment

          Working...