acadia
acadia

Reputation: 1657

Saving binary data into SQL SErver database in vb.net

I have a string with Binarydata that is 64bit. I want to store this data into SQlServer database and the column is varbinary(Max).

When I pass the string I am getting an error saying string cannot be converted into varbinary.

How do I store the binary data into sql server.

Thanks

Upvotes: 1

Views: 2285

Answers (1)

Lukasz Lysik
Lukasz Lysik

Reputation: 10620

INSERT INTO t1(col1) VALUES(CONVERT(varbinary(MAX),'text'))

Upvotes: 1

Related Questions