473,416 Members | 1,585 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

How to insert DBNnull into binary column via parameter list?

The table was created using the following script:
Expand|Select|Wrap|Line Numbers
  1. CREATE TABLE [USERS] (
  2. [USER_PASSWORD] binary(100) NULL
  3. );
The SqlCeCommand command text:
Expand|Select|Wrap|Line Numbers
  1. INSERT INTO [USERS]
  2.            ([PASSWORD])
  3.      VALUES
  4.            (@password);

Add the parameter:
Expand|Select|Wrap|Line Numbers
  1. command.Parameters.Add("@password", SqlDbType.Binary).Value = DBNull.Value;
Execute the command and get the error "Value was either too large or too small for an unsigned byte."

Can you help please?
Oct 15 '10 #1
2 1456
The problem has been resolved. Actually it's another column that caused the error. I thought it was this column even though I couldn't figure out anything wrong.
Oct 15 '10 #2
NeoPa
32,556 Expert Mod 16PB
No worries James, and thanks for posting to clarify.

BTW if you'd like your account ID changed to James Wang instead, then send a PM to MMcCarthy about it. She's an Admin and I'm sure she'd be happy to fix it for you.
Oct 15 '10 #3

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

Similar topics

7
by: Michael Birkmose | last post by:
Hi, Using gcc the following is possible: int some_function(struct local_struct { int member;} a); This function takes one parameter "a" of the type struct local_struct. This type is...
1
by: Vinny Vinn | last post by:
I would like to insert a new column in DataTable at a specified position at runtime. Unfortunatly, the DataColumnCollection does not expose any method to do this (like AddAt),Any ideas would be...
3
by: Joe | last post by:
I want to create a method similar to Console.WriteLine where I can pass in an unlimited parameter list. I know how to do this in C++ but have no clue in C#. Thanks for any help, Joe
3
by: tshad | last post by:
How do you get just the parameter list of URL - the part after the ?. For example, http://domain/default.asp?arg1=value&arg2=value&arg3=value I want to get the arg1=value&arg2=value&arg3=value ...
3
by: Art | last post by:
Hi, I need some advice with a binary column in a DataGrid. Everything seems fine except for one thing. In order to check a box, I have to click on it once to select it, and then click again to...
8
by: Roy Gourgi | last post by:
Hi, Is there a way to add a parameter list with only one statement as opposed to having one statement for each parameter. For example if I have 20 parameters (@p1, @p2 .... @p20) that I want to...
6
by: Maksim Kasimov | last post by:
i have two functions and both of them are to make changes into object field or get some results into caller function: void FooFunc1(FooClass& a) { ... void FooFunc2(FooClass* a) { ... or
4
by: mast2as | last post by:
Hi everyone I need to come up with an efficient solution to add/remove/access parameters to an object. Lets say I create an object "Cart" and at run time based on the user input, lets say we add...
3
mafaisal
by: mafaisal | last post by:
End of parameter list expected. Cannot define parameters after a paramarray parameter. Public Sub F_Bind(ByVal StrSql As String, ByVal ParamArray Ctrls() As Object,Optional ByVal Row as Integer...
6
by: HillBilly | last post by:
One question I have not figured out is how to learn which event parameter list is supported by a control? EventArgs, CommandEventArgs, what?
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.