null

What is wrong with this null check for data reader

c.Open() r = x.ExecuteReader If Not r("filename").IsDbnull Then imagepath = "<img src='images/'" & getimage(r("filename")) & " border='0' align='absmiddle'" End If c.Close() r.Close() I have also tried; If r("filename") Is DBNull.Value Then ...

How can I declare and initialize an array of pointers to a structure in C?

I have a small assignment in C. I am trying to create an array of pointers to a structure. My question is how can I initialize each pointer to NULL? Also, after I allocate memory for a member of the array, I can not assign values to the structure to which the array element points. #include <stdio.h> #include <stdlib.h> typedef str...

Setting nested object to null when selected option has empty value

Hello, I have a Class which models a User and another which models his country. Something like this: public class User{ private Country country; //other attributes and getter/setters } public class Country{ private Integer id; private String name; //other attributes and getter/setters } I have a Spring form where...

How to determine if variable is 'undefined' or 'null'

How do I determine if variable is 'undefined' or 'null'. My code is as follows: EmpName = $("div#esd-names div#name").attr('class'); if(EmpName == 'undefined'){ ///DO SOMETHING///// }; ...

Given an array of arrays, how can I replace all empty values with 0?

Example array $myArray[0] = array('23', null, '43', '12'); $myArray[1] = array(null, null, '53', '19'); $myArray[2] = array('12', '13', '14', null); All nulls should be replaced with 0. I was hoping someone would have an efficient way of doing this, perhaps a built in PHP function that I am unaware of. ...

Binding a null variable in a PreparedStatement

I swear this used to work, but it's not in this case. I'm trying to match col1, col2 and col3, even if one or more of them is null. I know that in some languages I've had to resort to circumlocutions like ((? is null AND col1 is null) OR col1 = ?). Is that required here? PreparedStatement selStmt = getConn().prepareStatement(...

Value cannot be null in sportstore exampe

Hi everyone, I am having this problem when I want to implement IoC for sportstore example. The code public WindsorControllerFactory(){ container = new WindsorContainer( new XmlInterpreter(new ConfigResource("castle")) ); var controllerTypes= from t in Assembly.GetExecutingAssembly().GetTypes() ...

Trying to Nullify Django model fields with method where model and fields are parameters

I'm trying to write a method like the below where a list of fields (a subset of all the fields) is passed in as a parameter and has their column values set to null. I would be happy of I could get a method with just the fields as a parameter like below, but having the model as a parameter would be even better. from my_project.my_app.mo...

Getting Null value with JSON from MySQL, how to retrive data from MySQL to JSON correctly?

I'm using following code but cannot return data from MySQL. This is the output: <script type="text/javascript"> var somethings= [null,null,null]; </script> It does have three post, but I couldn't get the title(message) output. EDIT: this is the code I'm using: <?php $session = mysql_connect('localhost','name','pass'); ...

Select fields containing at least one non-space alphanumeric character

(Sorry I know this is an old chestnut; I have found similar answers here but not an exact answer) I frequently hand type this kind of query from a console so I am always looking for easier to type solutions SELECT * FROM tbl_loyalty_card WHERE CUSTOMER_ID REGEXP "[0-9A-Z]"; -- exact but tedious to type or SELECT * FROM tbl_l...

Is there a shorthand way to denullify a string in C#?

Is there a shorthand way to denullify a string in C#? It would be the equivalent of (if 'x' is a string): string y = x == null ? "" : x; I guess I'm hoping there's some operator that would work something like: string y = #x; Wishful thinking, huh? The closest I've got so far is an extension method on the string class: public sta...

Using a ControlParameter in FilterParameters when the property is null

I have a DataList and FormView; they have separate datasources, though they pull the same info. The FormView's datasource has a FilterExpression to pull whatever's been selected on the DataList. On first load, the SelectedValue of the DataList is null (naturally). I expect the FilterExpression to result in zero rows, but it doesn't. ...

Check if an object is defined in html

In HTML, I have an object tag as follows: <OBJECT ID="objectid" CLASSID="some-class-id" CODEBASE="some-codebase"> I have written a function in JavaScript to access this object. I checked the null value as follows: if(objectid==null){-----} i want to check if the object is undefined or is empty. Do we have any functions to check s...

SQL count NULL cells

Dear All, I have the following problem. I have a table in a db, with many columns. I can do different kind of select queries, to show, for example, for each record that satisfies a condition: all cells from columns with names ending in _t0 all cells from columns with names ending in _t1 ... To get the column lists to form the querie...

Drop Down list null value not working for selected text c#?

Hi guys, Basically I have a drop down list which is populated with text and values depending on a selected index of a radio button list. The code is as follows: protected void RBLGender_SelectedIndexChanged(object sender, EventArgs e) { DDLTrous.Items.Clear(); DDLShoes.Items.Clear(); if (RBLGender.SelectedVa...

How Oracle 10g evaluates NULL in boolean expressions

if not (i_ReLaunch = 1 and (dt_enddate is not null)) How this epression will be evaluated in Oracle 10g when the input value of the i_ReLaunch = null and the value of the dt_enddate is not null it is entering the loop. According to the rules in normal c# and all it should not enter the loop as it will be as follows with the values. ...

Explaining NULL and Empty to your 6-year old?

I'm thinking in terms of Objects here. I think it's important to simplify ideas. If you can explain this to a 6-year old, you can teach new programmers the difference. I'm thinking that a cookie object would be apropos: public class Cookie { public string flavor {get; set; } public int numberOfCrumbs { get; set; } } ...

.Net: Is this correct: objSample.dispose() means objSample = null ?

Hi Just wanna to know objSample.dispose() is equal to objSample = null Indeed, can I get answer to such these questions from disassemblers? how? Thank you ...

What is null in Java?

What is null? Is null an instance of anything? What set does 'null' belong to? How is it represented in the memory? ...

wave.getState() returns null

When trying to call wave.getState() in my Google Wave gadget, I get back null (no state object). How can I initialize the Wave state object? I am working in the Wave Sandbox. My ModulePrefs contains the following: <Require feature="wave" /> <Require feature="rpc"/> I got the "rpc" feature from some google groups post when se...