Click here to Skip to main content
15,906,708 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have read an article about How to save an image into a Sql database using C# code, we have to load the image into an array of bytes first. But how we save an image when designing the database using Enterprise Manager or SQL query analyzer?
Please ask me more if you don't get what my problem is.
Thank you so much!
Posted
Updated 10-May-11 10:15am
v2

1 solution

Images are stored as binary objects so you would some how need to get the image in binary and enter it in a query. Not totally impossible but not worth the effort either.
 
Share this answer
 
Comments
[no name] 10-May-11 23:20pm    
What did you mean by "enter it in a query"?
I intend to save an image at design time using Enterprize Manager, for example when you want to save a name, you will type a name in the column "Name". But when saving an image, what will be entered?
I think a binary block of data doesn't like a text that can be copied and pasted, so I can't think out a solution to import an image into the column name "Image"!
Thank you so much!
[no name] 11-May-11 7:36am    
A binary object is represented by a long string of data, it can be copy and pasted, however, as I said it is not worth the effort. The Enterprise Manager and SQL Query Analyzer are not hte best tools for this. You should not be entering data directly into your database, use another tool, write an application, etc.
[no name] 12-May-11 9:31am    
Thank you! That's possibly a big difference between MS Access and SQL Server. Two ones are also Database Management Systems, but one can save data of image easily as an OLE object while the other can't do the same and must need a dedicated tool!

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