.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

SSRS 2005 + Null check box + change Label 'NULL'

Posted By:      Posted Date: September 13, 2010    Points: 0   Category :Sql Server
Hi, My management asked me if I can change the label of NULL check box for report parameters. They said that users may not understand 'NULL' label means. Is it possible to do. When I searched, some said it can be done by creating custom control and registering it in GAC etc. I appreciate your response. Thanks, Spunny

View Complete Post

More Related Resource Links

How to check for null/empty strings on dynamic objects?


What is the proper way to check for null or empty strings on dynamic objects? This is the only solution I've found so far:

if (admin.PasswordHash.GetType() == typeof(DBNull) || admin.PasswordHash == string.Empty)

If the field is null, the object returned is DBNull.Value, but if the field is empty string, it's return as a System.String object. This makes it impossible to do regular "admin.PasswordHash == DBNull.Value" check, as that will fail whenever the field has been set to empty string. Is my example the right (and only) way to go?

Store Null Data In image datatype in sql server 2005



i wanted to store image in sqlserver database image field and i did. But now in some cases i want to store null value in that image field please let me know how to do this using file uploader.please give complete sample code.


SSRS 2008 R2 - OnPostBack from ReportParameter - if no default set, throws Value can not be null

SSRS 2008 R2 - OnPostBack from Parameter selection - if no default set, throws Value can not be null java script error. This does not happen with SSRS 2008, only with R2. and only with report parameters that do not have a 'default' set.  Any suggestions would be greatly appreciated.

SSRS Report based on SSAS Cubes doesn't show NULL values correctly

I have a SSRS report which is based on an SSAS Cube. In the Cube the formating of numeric fields that NULL values are properly shown as NULL values. In the Cube Browser and Excel this is shown correctly. However when I design the report already the query against SSAS shows these fields as "0" instead of NULL. Is there a way to fix this or is this a bug ?  

NULL label doesn't appear on drop down or multi-select parameter.

Hi, I am using SSRS 2005 SP3. I have the following query that I use for my parameter: SELECT 0 AS c1, 'NOT Specified' AS c2 UNION SELECT 1 AS c1, NULL AS c2 UNION SELECT 2 AS c1, 'Test 1' AS c2 UNION SELECT 3 AS c1, 'Test 2' AS c2 Let's call my parameter prm1. The type of prm1 is string and it has "Allow null value" and "Allow blank value" options ticked. C1 is the value field and C2 is the label field for prm1. When I preview the report, and I didn't see NULL in my drop down list,  but that record has been shown as 1 (which is the value). I am wondering if this is a normal behavior of SSRS? It's not a big deal. I can replace NULL with something else, but I am just curious. Cheers, Uzzie


HelloI encountered the following error because in my stored procedure, some of the tables were truncated. I resolved the problem, but wanted to know how I can ensure that the report users will not get an error when they run the report and a record does not exist.  Build complete -- 0 errors, 0 warnings[rsRuntimeErrorInExpression] The ToolTip expression for the textrun 'Text.Paragraphs[0].TextRuns[0]' contains an error: The query returned no rows for the dataset. The expression therefore evaluates to null.[rsRuntimeErrorInExpression] The ToolTip expression for the textrun 'textbox3.Paragraphs[0].TextRuns[0]' contains an error: The query returned no rows for the dataset. The expression therefore evaluates to null.Preview complete -- 0 errors, 2 warnings Thanks,   Kajo  Kajoo

SSIS 2005 imports column as null

Hi, I am using SSIS 2005 to import excel files to sql server. I have a large excel file with many columns. I have one column -qty that not all rows have data for it-empty. For such rows a another column-value that i need to export is imported as NULL. If column QTY contains a value than column Value is imported fine but if column QTY is blank Value is NULL even if it does have a value. I have played with TypeGuessRows but it doesn't help. Any ideas? Thanks

SQL CE 3.5 Null Parameter Check



I cannot find a definitive answer for a very simple question. In SQL CE 3.5, I am attempting to execute the following:

            using (var connection = new SqlConnection(""))

                using (var command = connection.CreateCommand())

                    command.CommandType = CommandType.Text;
                    command.CommandText = "Select * From County Where CountyId = Coalesce(@Id,3)";
                    var dbParameter = command.CreateParameter();
                    dbParameter.ParameterName = "@

C# How to check prammatically if null value exists in database table (using stored procedure)?


How to programattically check if null value exists in database table (using stored procedure)?

I know it's possble in the Query Analyzer (see last SQL query batch statements)?

But how can I pass null value as parameter to the database stored procedure programattically using C#?

Although I can check for empty column (the following code passes string.Empty as parameter but how to pass null value?), I cannot check for null value in the following code snippet:

SQL Queries:

USE [master]

IF EXISTS (SELECT name FROM sys.databases WHERE name = 'ExampleDatabase')
DROP DATABASE [ExampleDatabase];

CREATE DATABASE [ExampleDatabase];

USE [ExampleDatabase];

DROP TABLE dbo.ExampleTable;

IsActive BIT,


SSRS 2005 - Change 2nd Parameter Value based on 1st Parameter Value (Non-queried)


I am wanting to filter my report based on Fiscal Year.  I have the first parameter as @STARTDATE and 2nd parameter as @ENDDATE.  The values for both of these are hardcoded in non queried.  When the user selects the @STARTDATE , I want to automatically set the value for the @ENDDATE parameter.  I'm doing it this way because I'm using BETWEEEN in my SQL Query.  Ideally, I will just have the @ENDDATE value hidden if possible.

So for example:

@STARTDATE has values of 10/1/2009 and 10/1/2010.
@ENDDATE has values of 9/30/2010 and 9/30/2011.

When @STARTDATE is selected to 10/1/2009, set the @ENDDATE value to 9/30/2010.
When @STARTDATE is selected to 10/1/2010, set the @ENDDATE value to 9/30/2011.

Any idea how/if this can be accomplished?

displaying the word label in asp:label if the query is null


how to disabled the word label in my aspx page if my query is null... i dont like to show the word label in my aspx page.

im using c# .net

is null for label?


hi, i have the error:

System.Web.UI.WebControls.Label' does not contain a definition for 'IsNull' and no extension method 'IsNull' accepting a first argument of type 'System.Web.UI.WebControls.Label' could be found (are you missing a using directive or an assembly reference?)

referring to:

Line 26:     Label3.Text = userProfile.UserName;
Line 27:
Line 28: if (!Label2.IsNull)
Line 29: {
Line 30: Label2.Visible = true;

Can anyone help? thanks!

How do I check if my ExecuteScalar() is null?


Hi all,

I know for a fact that the SQL statement below returns NULL but my code statement "if (obj != null)" is not working.
When I debug it I see a value of {} ... not sure what that is. Here is my code:

protected string GetLatestTimeStamp()
	DateTime latestTimeStamp1 = DateTime.UtcNow;
	string latestTimeStamp2 = String.Empty;

	string select = "select max(timeStamp) from dbo.JobHistory";

	SqlConnection conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
	SqlCommand cmd = new SqlCommand(select, conn);

		object obj = cmd.ExecuteScalar();

		if (obj != null)
		latestTimeStamp1 = (DateTime)obj;
		latestTimeStamp2 = latestTimeStamp1.ToString("yyyy-MM-dd HH:mm:ss.fff");
	return latestTimeStamp2;

So, even if SQL returns NULL, it still validates obj as NOT NULL !!! :(

Any ideas? Thank you!

How to check if session is null or not in C#



 Like to know the syntax to check Session is null or not in C#

Could be something like this....

if(Session["mysession"] == null)


Do something








Check For Null Values


When using an Access database I had to check text fields for null (which is accepable in my program) withcode like this:


If IsDBNull(oData.dr.Item("Media")) = False Then cboMedia.Text = oData.dr.Item("Media")

I am converting my program to SQL Server and this 'Seems" no longer necessary and this line of code seems to work:

cboMedia.Text = oData.dr.Item("Media"<

Check for Null Value or Spaces


I would like to check field FirstName if it's a null field or if the field has spaces in it.

My FirstName field sometime is NULL or it has spaces in it.

I would like to check for those two scenario.


Users getting logged out because HttpContext.Current is null


We've  been trying to fix this one for a couple years, and I'm just out of ideas, so any help is really appreciated!

We've got a fairly large, complex web application that uses Forms Authentication to authenticate users.  Throughout the application we store and retrieve information about users in the Session object, and in some cases in cookies.  In a couple places we check for the existence of the context, and if it's null we send the user back to the login page to re-establish the session. 

Just a quick run-down of this web app: C#, .NET 3.5, IIS 6, ASP.NET State Service to manage session

As for the session timer, we use our own home-grown timer, which is basically a client-side timer, which is backed up by a check to the SQL database to see when their last activity was.  This seems to work well for us.  It's not perfect, but it allows us to notify the user before the session times out, and allows us to be certain we're not logging a user out before their 60 minutes of inactivity is up.

What's happening is that certain users are being logged out after just a few minutes.  We've eliminated the timer as a cause and believe what's happening is the HttpContext.Current is null, so the user is logged out.  We do not know why the HttpContext.Current is null, and I underst

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend