RSS Forums RSS
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 496 | Replies: 1 | Solved
Reply
Join Date: Mar 2008
Posts: 55
Reputation: dskumar_85 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
dskumar_85 dskumar_85 is offline Offline
Junior Poster in Training

analys the programm and reply

  #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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,657
Reputation: peter_budo is just really nice peter_budo is just really nice peter_budo is just really nice peter_budo is just really nice 
Rep Power: 12
Solved Threads: 311
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is online now Online
Code tags enforcer

Re: analys the programm and reply

  #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, JAVAWUG (Java Web User Group), Coding the Architecture
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 6:32 am.
Newsletter Archive - Sitemap - Privacy Statement - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC