473,395 Members | 1,335 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,395 software developers and data experts.

Passing null parameter to objectdatasource

I have an objectdatasource on a dataset.
From a webform (textbox) I want to pass a parameter to this dataset which
can be null. If so I want all the rows of that dataset to be retrieved in a
grid.
(WHERE (MEMBER_ID = ISNULL(@MEMBER_ID, MEMBER_ID)))

This clause seems to work fine in preview of the dataset.
In the parameter definition screen of my objectdatasource I set
ConvertEmptyStringtonull to true and I don't specify a default value.
When I try to view the page in the browser I get the following error:

Value cannot be null.
Parameter name: MEMBER_ID
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.
Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: MEMBER_ID
Source Error:

Line 2506: Me.Adapter.SelectCommand = Me.CommandCollection(0)
Line 2507: If (MEMBER_ID Is Nothing) Then
Line 2508: Throw New
System.ArgumentNullException("MEMBER_ID")
Line 2509: Else
Line 2510: Me.Adapter.SelectCommand.Parameters(0).Value =
CType(MEMBER_ID,String)

--
How can I solve this problem, any ideas? Thanks
Diane
Jul 27 '06 #1
0 2006

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Jaime Stuardo | last post by:
Hi all.. I have created a business logic component that is used from my ASP.NET webform. It works, but connection string to the database is hard coded, as in this method : public DataSet...
13
by: anonymike | last post by:
Hello, I started working with the ObjectDataSource today. I have the select, and have been working on getting the update method to work. Here is the asp code for my Data source: ...
3
by: Robert | last post by:
What is the best way to pass a parameter to an ObjectDataSource. I am able to add a new parameter to the SelectParameters, but I would like to just assign a value to an existing parmeter at...
3
by: Jeff | last post by:
Hey ASP.NET 2.0 This the ObjectDataSource in my UserControl, <asp:ObjectDataSource ID="odsMessage" runat="server" SelectMethod="ExecuteMessage" TypeName="AH.MyNetwork.BLL.Network.Message">...
7
by: TS | last post by:
I was under the assumption that if you pass an object as a param to a method and inside that method this object is changed, the object will stay changed when returned from the method because the...
2
by: Ismail | last post by:
Hello, I have grid view which can go into edit mode. I have fields one of which is primary key I dont want to display this field but will use this field in my update method. If I make the...
0
by: Kursat | last post by:
Hi, I have a data access library which contains some wrapper methods for my Stored Procedures. I bind data access methods to data controls by using ObjectDataSource objects. The problem is some...
0
by: =?Utf-8?B?UGF1bA==?= | last post by:
I have a ListBox server control named "lb_dates" with a SelectionMode of "Multiple". The user can select multiple dates from the listbox. I have ObjectDataSource named "ods_rfq" with a...
2
by: Jeff | last post by:
hi asp.net 2.0 I have a gridview which I'm trying to update a row within. When I click on the Update button, my website crash. It displays a webpage saying that a parameter is missing. So I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
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,...
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...

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.