473,467 Members | 1,307 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

passing null parameter

17 New Member
Expand|Select|Wrap|Line Numbers
  1. Private Sub BPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BPrint.Click
  2. Dim frm As New FrmPrintReport 'reports
  3. Dim cr As New CRepResponsable
  4. cr.SetParameterValue(0, Val(Me.TBAccountNumber.Text))'integer
  5. cr.SetParameterValue(1, Me.TBAccountNumber.Text)'string
  6. cr.SetParameterValue(2, vbNull) 'integer
  7. cr.SetParameterValue(3, vbNull) 'string
  8.  
  9. frm.CrystalReportViewer.ReportSource = cr
  10. frm.MdiParent = Me.MdiParent
  11. frm.Show()
  12. End Sub
  13.  
  14. i have the code above. i could not pass a null parameter, to the crystal reports. i will have an empty report  i tried vbnull.null and vbnull.empty same result.
  15. but if I put
  16. cr.SetParameterValue(2, Val(Me.TBSubAccount.Text))) 'integer 'not null
  17. cr.SetParameterValue(3, Me.TBSubAccount.Text) 'string 'not null
  18. the report display the values.
here is the select expert formula (CR):
Expand|Select|Wrap|Line Numbers
  1. {CUSTOMERS.SUB_ACCOUNT_NUMBER} = {?SubAccount_String} and
  2. {ecole.serial} = {?AccountNumber} and
  3. {CUSTOMERS.ACCOUNT_NUMBER} = {?AccountNumber_String} and
  4. {ecole.sub_account} = {?SubAccount} 
  5.  
How could i pass a null parameter?
Jan 9 '07 #1
2 2221
bplacker
121 New Member
you can't just pass "" as an empty string instead of a null value?
Jan 9 '07 #2
kenobewan
4,871 Recognized Expert Specialist
Have you tried DBNull.Value?

Hope that this helps.
Jan 10 '07 #3

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

Similar topics

3
by: WGW | last post by:
Though I am a novice to MS SQL server (2000 I believe), I can do almost! everything I need. Maybe not efficiently, but usefully. However, I have a problem -- a complex query problem... I can...
10
by: Resant | last post by:
I have a query : Exec 'Select * From Receiving Where Code In (' + @pCode + ')' @pCode will contain more than one string parameter, eg : A1, A2, A3 How can i write that parameters, I try use :...
2
by: PK | last post by:
Hi, I have an application that opens a Crystal report document and passes in a value to a parameter in the report (pointing to an Oracle DB). However, if I want to pass a "null" value to retrieve...
5
by: Bucky Pollard | last post by:
I am calling a PVCS DLL function from C#. According to the documentation, I can pass NULL to any output parameter that I do not want to receive data back for. How do I do this? Every thing I've...
6
by: MSDNAndi | last post by:
Hi, I get the following warning: "Possibly incorrect assignment to local 'oLockObject' which is the argument to a using or lock statement. The Dispose call or unlocking will happen on the...
3
by: Ross McLean | last post by:
Hi all, I've been teaching myself C# for a new project at work. I have a bit of a background in c++ and java but never been what you could call a guru. I'm having some strange things happening...
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: ...
12
by: Andrew Bullock | last post by:
Hi, I have two classes, A and B, B takes an A as an argument in its constructor: A a1 = new A(); B b = new B(a1);
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...
4
by: Deckarep | last post by:
Hello fellow C# programmers, This question is more about general practice and convention so here goes: I got into a discussion with a co-worker who insisted that as a general practice all...
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...
1
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
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.