>> string fnrdata = "<pre>"; >> string fnrLine = ""; >> using (StreamReader fnr = File.OpenText(nd[3])) >> { >> while ((fnrLine = fnr.ReadLine()) != null) >> fnrdata = fnrdata + fnrLine + "<br>"; >> fnrdata = fnrdata + "";
>>procedure [dbo].[InsertNewFile] >> @SID varchar(8), >> @County varchar(3), >> @TimeRecvd datetime, >> @FileName int, >> @FileData varchar(max) -- parameter for file string >>as >>begin >> declare @FData varbinary(max) >> set @FData = convert(varbinary(max), @Filedata) >>-- the following statements were a suggested solution, which doesn't error, but also doesn't insert the @FileData. A record IS inserted, but --- the FileData field contains only 52 characters >> --declare @FD varchar(1) = '' >> --set @FD = cast('' as varchar(max)) + @FileData >> --set @FData = convert(varbinary(max), @FD) >> >> open symmetric key FNSymKey >> Decryption by Certificate FNCert >> >> if not exists(Select 1 from FNFiles where FileName = @FileName) >> Insert into FNFiles(SID, County, TimeRecvd, FileName, FileData, InsertDate) >> values (@SID, @County, @TimeRecvd, @FileName, >> EncryptByKey(Key_GUID('FNSymKey'),@FData), getdate()) >> >> close symmetric key FNSymKey >>end >>>>