Hi developers,
When i am tried to insert base64 string to database i got the following error
"Implicit conversion from data type nvarchar to varbinary(max) is not allowed. Use the CONVERT function to run this query."
My base64 string: iVBORw0KGgoAAAANSUhE....
My database query:
Table :
CREATE TABLE [dbo].[Mas_CustomerKYCImageDetails](
[IDProofImageName] [varchar](2000) NULL,
[IDProofImageData] varbinary(max)
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
Stored procedure
CREATE Proc [dbo].[Cli_Ins_CustomerKYCImageDetails]
(
@IDProofImageName varchar(2000),
@IDProofImageData varbinary(max)
)
as
Begin
Insert into Mas_CustomerKYCImageDetails
(
IDProofImageName,
IDProofImageData
) values
(
@IDProofImageName,
CONVERT(varbinary(MAX), @IDProofImageData)
)
If anyone know how to resolve this error, kindly suggest me
Thanks and Regards,
Paul.S