Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add record with a binary field with C#

Status
Not open for further replies.

Kai77

Programmer
Jun 7, 2004
77
NL
I want to upload a file from a webpage and store the file in a binary field of a record in SQL 2005 Server. What data type do i need to use to upload the file content?
 
In the database, use one of: binary, varbinary, or image.

In your C# code, use an array of byte.

When using SqlParameter objects, be sure to set the size of your data (one of the properties) before trying to send it to the database.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top