Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: MySQL VB.NET
how i can insert the image into mysql database.
 
some people insert image into database.
some people insert image path into database
 
which is the best store method in the database
 
i'm using ODBC connection for mysql database
 
i don't know how to code for insert image into database
 
i'm really need this
Posted 2-Oct-10 21:53pm
Edited 4-Oct-10 21:53pm
thatraja241.9K
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

See here[^].
  Permalink  
Comments
Dalek Dave at 5-Oct-10 4:56am
   
Good Link
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

For Storing images in database vs storing image path in database + store images in seperate folder
 
Link 1[^]
 
Link 2[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

create a table ....
 
CREATE TABLE [dbo].[imgtable](
    [id] [int] NULL,
    [img] [image] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
 
insert vb.net code
 
Dim cmd As New SqlCommand("insert into imgtable (id,img) values ( @id,@img)", cnn)
cmd.Parameters.AddWithValue("@id", id)
cmd.Parameters.AddWithValue("@img", content)
cmd.ExecuteNonQuery()
 
full source ... Insert image into Database
 
Kerry
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web03 | 2.8.141015.1 | Last Updated 28 Mar 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100