Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,207,641 members, 7,999,822 topics. Date: Monday, 11 November 2024 at 02:04 PM |
Nairaland Forum / Science/Technology / Programming / Vb.net Save Picture (3140 Views)
I Need A Help To Write A Simple Login Form Using Vb.net / Vb.net Crystal Report & Dataset / Post Ur Vb 6.0 Questions Here (2) (3) (4)
Vb.net Save Picture by bigafees: 3:14pm On Dec 05, 2011 |
D N'lander, i used odbc connection for my sql server in vb.net, pls with ds i need code to save picture into database |
Re: Vb.net Save Picture by IOludayo(m): 12:52pm On Dec 06, 2011 |
I'm new 2 VB.NET n I nd e-books n mentorship. |
Re: Vb.net Save Picture by 9ja4eva: 8:48pm On Jan 20, 2012 |
Any VB pro in here please?I need some help |
Re: Vb.net Save Picture by samm(m): 10:08am On Jan 21, 2012 |
Using the code below. I'm assuming you have added an image control (ImageControl) and assigned and image to the control on your form. Also, I'm assuming you have created a sql server table with a column type of image. To save to SQL Server you have to save image to MemoryStream array(ms) then assign to SQL parameter value (image). Dim ms As New MemoryStream() Me.ImageControl.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg) spCommand.Parameters.AddWithValue("@image", ms.ToArray()) spCommand.ExecuteNonQuery() Your sql script look like this: INSERT INTO ImageTable(imagecol) VALUES (@image) Let me know if you have any more questions. |
(1) (Reply)
Come Become Part Of Something Big: Let's Build A Fintech Startup Together. / Sell Your Amazon And Itunes Card / a
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 8 |