Results 1 to 3 of 3

Thread: saving picturebox image to sql server

  1. #1

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    saving picturebox image to sql server

    hi,
    I have a code below using c#. But wen I execute this code the error occur


    strsql2.CommandText = "insert into hrattach(idkey,pb1)values(@idkey,@pb1)";
    strsql2.Parameters.Add("@idkey",SqlDbType.NChar,6 );
    strsql2.Parameters.Add("@pb1",SqlDbType.Image);
    strsql2.Parameters["@idkey"].Value ="01019";
    strsql2.Parameters["@pb1"].Value =picturebox1.Image; ' Error happens here
    strsql2.CommandType = CommandType.Text;
    strsql2.ExecuteNonQuery();

    thanks
    popskie

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: saving picturebox image to sql server

    I dont know sql, but at least describe the error so someone who does may be able to help you better
    what's the exact error message??
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  3. #3

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    Re: saving picturebox image to sql server

    The error message is Object must Implement ICovertible.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width