Click here to Skip to main content
15,879,326 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Updated 4-Oct-10 21:53pm
v2

See here[^].
 
Share this answer
 
Comments
Dalek Dave 5-Oct-10 4:56am    
Good Link
For Storing images in database vs storing image path in database + store images in seperate folder

Link 1[^]

Link 2[^]
 
Share this answer
 
create a table ....

SQL
CREATE TABLE [dbo].[imgtable](
    [id] [int] NULL,
    [img] [image] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]


insert vb.net code

VB
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
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900