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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Overflowing the Image Column on SQL 2000 server?

Status
Not open for further replies.

Stat792

Programmer
Jan 7, 2004
12
0
0
US
I keep getting a 'Binary data would be truncated' error when I try to write large files to my image column, and the write does not occur. But there's only 2,158,080 bytes in the file I'm writing! I thought the image type could handle 2,147,483,647 bytes.

The app is VB.net, and I'm just putting the data in a data row and calling update. It works fine for very small files, so whats the deal?

Here's an example of the code:

*The translator class returns a byte() array*

'Encode the file into binary
DocData("DocName") = GetFileNameFromPath(FilePath)
DocData("BLOB") = Translator.ToBinary(FilePath)
DocData("docType") = FilePath.Substring(FilePath.Length - 3, 3)
dsDoc.Tables(0).Rows.Add(DocData)

'Save the document and cleanup
daDoc.Update(dsDoc) <-- Error occurs here **
dsDoc = Nothing
daDoc = Nothing
DocData = Nothing
CB = Nothing

Thanks for the help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top