473,796 Members | 2,482 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error "beyond the limite of sql_variant DataType"

3 New Member
in order to upload image to database,i put a fileUpload control in the InsertItemTempl ate 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,p art 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
2 1520
Plater
7,872 Recognized Expert Expert
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
shahalashamo
3 New Member
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('')%>" .
Aug 21 '08 #3

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

Similar topics

2
2929
by: Stephen Briley | last post by:
For some reason, my posts are scrubbed as attachments. Lets hope that sending from the yahoo account works. I'm new to Python and I'm trying to do some database work with MS Access, but I can't seem to get around a "datatype mismatch error". Here's an example table that I'm working with... ID name dept 1 steve acct
1
2339
by: Chumley the Walrus | last post by:
I'm trying to insert a value into sql dbase, the value "amount" is a money datatype (currency). Below is the parameter for the "amount" value: cmd.Parameters.Add(New SQLParameter("@amount", frmamount.text)) ....and how I am grabbing the "amount" from the textbox control: <asp:textbox id="frmamount" class="inputBox-gr" runat="server" />
3
3532
by: Scott | last post by:
I have a database with an input form. The field "DailyID" on the form is to increment automatically with each new entry, then reset itself back to "1" at midnight and/or the change of date. However, the DAILYID increments automatically to "10" just fine, but does not go beyond "10" until the date changes. I have the following code in my form's CURRENT event: Private Sub Form_Current()
0
1483
by: Andrew Burgher | last post by:
Feeding the following .xsd into the XsdObjectGen (v1.4.2.0) tool produces an invalid attribute: with DataType="System.String". Has anybody seen this behaviour before? Is this a bug in XsdObjectGen? or a problem with the input schema? I'm trying to avoid hacking the generated code... In: <?xml version = "1.0" encoding = "UTF-8"?> <xsd:schema elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
3
3194
by: Jon | last post by:
I'm learning about datatables. When using the example provided by MS in the ..NET Framework Class Library for DATATABLE (see below) I get an error on line 3 that says "Type expected". Is something missing from the code? Thanks - Jon Private Sub MakeParentTable() ' Create a new DataTable. Dim myDataTable As Datatable = New Datatable("ParentTable")
3
7738
by: John Ossmann | last post by:
I'm not sure where to find it exactly, but does anyone know how much data a column of type "text" in a postgres DB can hold? Thanks
0
1569
by: mathewbutler | last post by:
Access 2000 SR-1 I've spent some time investigating this, and researching both here and on the MS support site. Briefly; Problem Description: ------------------------------- I have the following query which I am using to export data into CSV format;
5
1693
by: spacecoyote | last post by:
Hello, I have a class inside a class. I want to set a variable "rect" in that class "textrender" to the value of a variable "rect" in the parent class "textbox". I don't know how to do this. class textbox(pygame.sprite.Sprite): # Textbox class def __init__(self): rect=*something*
2
15950
by: Randy Smith | last post by:
Hi, Does anyone have any good techniques on how to convert an SQL Server 2005 "money" datatype into the ASP.Net "double" datatype? OR, should we be using "decimal" at both ends? TIA, Randy Smith
0
9680
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9528
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10455
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10173
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10006
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7547
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.