Pls. help me with this error...
'Read the contents in to a byte array
Dim objMyData() As Byte
objMyData = CType(objMyRow("Document"), Byte()) <<<<<<<ERROR
Dim objMyFile As New FileStream("C:\temp\document.doc", FileMode.OpenOrCreate, FileAccess.Write)
objMyFile.Write(objMyData, 0, objMyData.Length)
Unable to cast object of type 'System.String' to type 'System.Byte[]' in vb.net
WHERE Document is a column in table in sql2005 that has a varchar(max) dataype.
I've tried converting it to
'Dim encoding As New System.Text.ASCIIEncoding()
'objMyData = encoding.GetBytes(objMyRow("Document"))
but the resulting document has an ascii format.
Thank you in advance....
'Read the contents in to a byte array
Dim objMyData() As Byte
objMyData = CType(objMyRow("Document"), Byte()) <<<<<<<ERROR
Dim objMyFile As New FileStream("C:\temp\document.doc", FileMode.OpenOrCreate, FileAccess.Write)
objMyFile.Write(objMyData, 0, objMyData.Length)
Unable to cast object of type 'System.String' to type 'System.Byte[]' in vb.net
WHERE Document is a column in table in sql2005 that has a varchar(max) dataype.
I've tried converting it to
'Dim encoding As New System.Text.ASCIIEncoding()
'objMyData = encoding.GetBytes(objMyRow("Document"))
but the resulting document has an ascii format.
Thank you in advance....