By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,347 Members | 2,091 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,347 IT Pros & Developers. It's quick & easy.

Error "beyond the limite of sql_variant DataType"

P: 3
in order to upload image to database,i put a fileUpload control in the InsertItemTemplate of the formView,the code as follows:
Expand|Select|Wrap|Line Numbers
  1. <asp:FileUpload ID="FileUploadKeyImage" runat="server" FileBytes='<%# Bind("keyImage") %>' />     
and the FormView is bind to a sqlDataSource,part of code in sqlDataSource is
Expand|Select|Wrap|Line Numbers
  1.  <asp:Parameter Name="keyImage" Type="object" />
,but when i click the "insert" button ,there is a error show that parameter @keyImage beyond the limite of sql_variant DataType.the dataType of keyImage field in the table is Image.what's wrong ?I don't know.
Aug 19 '08 #1
Share this Question
Share on Google+
2 Replies


Plater
Expert 5K+
P: 7,872
Hmm Image maps to a byte[] that supports up to (2^31)-1 bytes. Don't know why it would be too big.
It might be because you use "object" as the type for it in the parameter name?

I would do it in the backend rather then the frontend, sometimes it's easier to see whats wrong. Although its rather different then doing it in the designer and could be confusing if you've never done it before.
Aug 20 '08 #2

P: 3
Hmm Image maps to a byte[] that supports up to (2^31)-1 bytes. Don't know why it would be too big.
It might be because you use "object" as the type for it in the parameter name?

I would do it in the backend rather then the frontend, sometimes it's easier to see whats wrong. Although its rather different then doing it in the designer and could be confusing if you've never done it before.
Thanks for your answer.
But I have no other choices but for the "object".Because the support type are the basic type such as int,byte,bool and so on.the only type for binary data is the "object".yes,i can do it in the backend,but it require more writed-code by hand,and also can't use "<%#Bind('')%>".
Aug 21 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.