views:

22

answers:

2

how tosave an image data type to table using sql server 2005 who its in visual studio 2005.thanks

A: 

This might help. Difficult to tell exactly what you want from your question.

Storing Binary Files Directly in the Database Using ASP.NET 2.0

Martin Smith
+1  A: 

ntext, text, and image (Transact-SQL)

ntext, text, and image data types will be removed in a future version of MicrosoftSQL Server. Avoid using these data types in new development work, and plan to modify applications that currently use them...

try this:

CREATE TABLE YourTable
(
    ID int,
    YourImage varbinary(max)
)


INSERT INTO YourTable
        (ID , YourImage) 
    SELECT 
        10, BulkColumn 
        FROM Openrowset( Bulk 'C:\YourImage.jpg', Single_Blob) as YourImage
KM