I have a problem with saving a posted file to the database as a text column.
I know that array of bytes easily can be saved to an image field to the sql by using the sql parameter with type images. I tried this to a text file by just changing it to text and gives me an error...
Public Sub FileUpload(ByVal FileID As Integer, ByVal FileType As String, ByVal FileContents() As Byte, ByVal FileSize As Long)
Dim parameterFileContent As New SqlParameter("@FileContents", SqlDbType.IMAGE, FileSize)
parameterFileContent.Value = FileContents
================================================
that one works perfectly but if i used SQLDBTYPE.TEXT instead of sqldbtype.image,
I received an error that says: Object must implement IConvertible....
Any suggestions...thanks!
I know that array of bytes easily can be saved to an image field to the sql by using the sql parameter with type images. I tried this to a text file by just changing it to text and gives me an error...
Public Sub FileUpload(ByVal FileID As Integer, ByVal FileType As String, ByVal FileContents() As Byte, ByVal FileSize As Long)
Dim parameterFileContent As New SqlParameter("@FileContents", SqlDbType.IMAGE, FileSize)
parameterFileContent.Value = FileContents
================================================
that one works perfectly but if i used SQLDBTYPE.TEXT instead of sqldbtype.image,
I received an error that says: Object must implement IConvertible....
Any suggestions...thanks!