473,856 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
+ 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
  9. frm.CrystalReportViewer.ReportSource = cr
  10. frm.MdiParent = Me.MdiParent
  11. frm.Show()
  12. End Sub
  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} 
How could i pass a null parameter?
Jan 9 '07 #1
2 2235
121 New Member
you can't just pass "" as an empty string instead of a null value?
Jan 9 '07 #2
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

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 create a parameter query in a stored procedure, but how do I use the result set of a parameter query in a select query (in the same or another sp)? In short, if a select query contains a result table that is generated as a parameter query, how do I...
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 : set @pCode='A1','A2','A3' but get an error : Incorrect syntax near ','
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 all records that have no data for the specified field that the parameter is a condition of (ie. SELECT * from <table> where <field> is null"), it returns nothing. I think CR is building the SQL statement like "SELECT * from <table> where <field>...
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 tried results in a compiler error. TIA: Bucky Pollard My declaration is below. I am only looking for one piece of information, so ultimately I'd like to call the function something like this.
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 original value of the local." My code is: using System; using System.Collections.Generic;
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 when I pass a class as a parameter to a Windows Form. Basically, I have a class that has several fields, two of these fields are an instance of an inner class, the rest are basic value types (bool's in this case). I have a windows form, the...
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: <asp:ObjectDataSource ID="dsourceApps" runat="server" SelectMethod="getAllApplications" TypeName="AppMgr.AppManager" UpdateMethod="updateAppHdr" ConflictDetection="CompareAllValues"
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);
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 object is a reference type? my code is not proving that. I have a web project i created from a web service that is my object: public class ExcelService : SoapHttpClientProtocol {
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 objects should be passed by reference using the ref keyword generally speaking because as the writer of code you are conveying your intentions that an Object should/can be modified by your function.
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,...
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...
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
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,...
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
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.