analys the programm and reply

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Mar 2008
Posts: 63
Reputation: dskumar_85 is an unknown quantity at this point 
Solved Threads: 1
dskumar_85 dskumar_85 is offline Offline
Junior Poster in Training

analys the programm and reply

 
0
  #1
Apr 2nd, 2008
hai i am using the following code to apply the watermark and save in specific location and then upload the image to database

  1. [ byte[] img1 = new byte[fileupload1.postedfile.contentlength];
  2. Httppostedfile image = fileupload1.postedfile;
  3. image.Inputstream.read(img1,0,(int)fileupload1.postedfile.contentlength);
  4. Bitmap bm1 = new bitmap(new system.IO.Memorystream(imd1));
  5. Graphics grp = Graphics.FromImage(bm1);
  6. grp.smoothingMode = smoothingMode.AntiAlise;
  7. grp.Drawstring("name" ,new font("Arial",20),systemBrushes.WindowText,250,250);
  8.  
  9. string a1 = server.mapPath(@"image\\winteer1.jpg");
  10. bm1.save(a1);
  11. image1.imageurl=a1;
  12. Bitmap a2 = new Bitmap(image1.imageurl);

up to this the program work's perfectly while upload to the database i show the error ..


  1. sql connection con = new sql connection (conn);
  2. sql command com = new sqlcommand (insert into );
  3. com.parameters.Addwith value("@image",a2);
  4. con.open();
  5. com.ExecuteNonquery();
  6. con.close();

in that com.ExecuteNonquery() the error show's like (no mapping exits from object type system.drawing .Bimap to a known managed provider native type)

plz reply me .............
Last edited by peter_budo; Apr 4th, 2008 at 5:30 am. Reason: Keep It Organized - please use [code] tags
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,238
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 490
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: analys the programm and reply

 
0
  #2
Apr 4th, 2008
This post is marked as solved. Did you find solution? Would you mind to share it with others?
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the ASP.NET Forum
Thread Tools Search this Thread



Tag cloud for ASP.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC