1,105,406 Community Members

How to Insert Picture to SQL Database

Member Avatar
KosalKauv
Newbie Poster
2 posts since Nov 2008
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Dear Sir/ Madam

I would like you to help me as below:
I want to create a project for manage student information and i have one table store student information in the table have student ID, Student Name, Address, Photo.... and i want to insert student information with photo and i want to display it and using VB.net 2005 and SQL Server 2000.

Please help me to give the sample.

thanks
Best Regard
Kosal

Member Avatar
sierrainfo
Junior Poster
144 posts since May 2008
Reputation Points: 0 [?]
Q&As Helped to Solve: 9 [?]
Skill Endorsements: 0 [?]
 
0
 
Member Avatar
Teme64
Veteran Poster
1,039 posts since Aug 2008
Reputation Points: 189 [?]
Q&As Helped to Solve: 208 [?]
Skill Endorsements: 9 [?]
 
0
 

Basically you convert an image to an array of bytes and store the byte array to image- or blob-typed field. This same principal applies to most databases, not just SQL Server.

There's a code snippets in my blog which can be used to insert pictures to DB:
- converting image to binary data: Convert image to byte array and vice versa
- saving binary data to DB: Save binary data to SQL Server with VB.NET

You may want to check also sierrainfo's links, but basically they have the same idea.

Member Avatar
KosalKauv
Newbie Poster
2 posts since Nov 2008
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Dear Sir

Thank you for your help, but I still don't understand about this can you give me the program becuase my knowlage is low.

thanks

Member Avatar
Teme64
Veteran Poster
1,039 posts since Aug 2008
Reputation Points: 189 [?]
Q&As Helped to Solve: 208 [?]
Skill Endorsements: 9 [?]
 
0
 

You have already got links to samples. Take a look at them, read VB.NET tutorials and learn. When you run into a problem you can't solve yourself, ask for help in these forums. Here's a plenty of professional programmers and enthusiastic hobbyist who are ready to help you.

These forums are not any "free-coder-for-you" sites. If you want someone to make the application for you, hire a programmer. There are other sites for that.

Sorry for the "hard" text. Happy learning :)

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article