Error "beyond the limite of sql_variant DataType"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shahalashamo
    New Member
    • Aug 2008
    • 3

    Error "beyond the limite of sql_variant DataType"

    in order to upload image to database,i put a fileUpload control in the InsertItemTempl ate of the formView,the code as follows:
    Code:
    <asp:FileUpload ID="FileUploadKeyImage" runat="server" FileBytes='<%# Bind("keyImage") %>' />
    and the FormView is bind to a sqlDataSource,p art of code in sqlDataSource is
    Code:
     <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.
    Last edited by Curtis Rutland; Aug 19 '08, 01:17 PM. Reason: Added Code Tags - Please use the # button
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    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.

    Comment

    • shahalashamo
      New Member
      • Aug 2008
      • 3

      #3
      Originally posted by Plater
      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".Becaus e the support type are the basic type such as int,byte,bool and so on.the only type for binary data is the "object".ye s,i can do it in the backend,but it require more writed-code by hand,and also can't use "<%#Bind('')%>" .

      Comment

      Working...