I have a long string of data, that is to be stored in a db, with column type of varbinary(max). Problem is, I can't get an insert statement from within VB that will let me do such. I tried using the convert command in my InsertQuery string, but it doesn't like the syntax.
THe field that needs to be a varbinary(max) is "ContentData".
The exact error message is "Implicit conversion from data type varchar to varbinary(max) is not allowed. Use the CONVERT function to run this query"
Dim dbConnection = "User Id=xx;Password=xxxxxx;Server=x.x.x.x;Initial Catalog=Content"
Dim myConn As New SqlConnection(dbConnection)
Dim myInsertQuery As String = "INSERT INTO FileContent ( ContentData, ContentName, ContentDate) Values('myContent', 'myContentName', 'myContentDate')"
Dim myCommand As New SqlCommand(myInsertQuery)
myCommand.Connection = myConn