I need to programatically check whether a nested property/function result in a lambda expression is null or not. The problem is that the null could be in any of the nested subproperties.
Example. Function is:
public static bool HasNull<T, Y>(this T someType, Expression<Func<T, Y>> input)
{
//Determine if expression has a nul...
Whats wrong with following code? :(
int? parentFolderId = null;
if( this.Request.QueryString ["folderId"] != null )
parentFolderId = Convert.ToInt32( this.Request.QueryString ["folderId"] );
f = ( from x in this.EntityDataContext.folders
where x.parent_id == parentFolderId
select x ).ToList();
It returns nothing! Though there ARE...
Question title says it all. I'm using PHP5 and MySQL.
EDIT:
I'm using mysql_...() functions.
...
For some reason the item "description" returns null with the following code:
<?php
include('db.php');
$result = mysql_query('SELECT * FROM `staff` ORDER BY `id` DESC LIMIT 2') or die(mysql_error());
$rows = array();
while($row = mysql_fetch_assoc($result)){
$rows[] = $row;
}
echo json_encode($rows);
?>
Here is the schema for my ...
In SQL 2005/8 I'm looking to convert a column in select query to a NOT NULL column.
coalease() and isnull(), although fine functions, is not what I'm looking for. I want the select to throw an error is any of the data is NULL.
Is this possible?
[Update]
Clearly the best approach would be to modify the source table, unfortunatly in th...
MS Access: How to replace blank (null ) values with 0 for all records?
I guess it has to be done using SQL. I can use Find and Replace to replace 0 with blank, but not the other way around (won't "find" a blank, even if I enter [Ctrl-Spacebar] which inserts a space.
So I guess I need to do SQL where I find null values for MyField, then...
I mean... I "set" it to NULL. So isset($somethingNULL) == true?
...
Hi,
I'm creating an application in RubyCocoa and I have this code:
fileContents = OSX::NSAttributedString.alloc.initWithData_options_documentAttributes_error_(data, null, null, outError)
It gives me this error:
2009-12-31 19:42:54.317 Ruby Text[3791:a0f] MyDocument#readFromData_ofType_error_: OSX::OCMessageSendException: Can't get O...
Hi everyone, I have some questions in C#
what are the differences between null comparisons null == value and value == null (value is a variable of any kind: int, string, float,...)
I heard that using prefix increment ++i instead of i++ in some case will enhance the program performance. Why is it so?
I have a snippet code as follow:
...
If I have a
class A
{
private:
Widget* widgets[5];
};
Is it guaranteed that all pointers are NULL, or do I need to initialize them in the constructor? Is it true for all compilers?
Thanks.
...
API:
namespace ClassLibrary1
{
public class Class1
{
public static string Test(string input)
{
if (input == null)
return "It's null";
if (input == string.Empty)
return "It's empty";
else
return "Non-empty string of length " + inpu...
function submitcheck()
{
var f = document.form1;
if (f.rbTemplate!= null)
{
...
alert('Please choose template');
return false;
...
}
if (f.rbColorId!= null)
{
...
alert('Please choose template color');
return false;
...
}
}
function ShowColor()
{
var f= document.form1;
...
I'm curious why a variable overtly assigned to nil, prints as (null) with NSLog:
NSString *myVar = nil;
NSLog(@"%@", myVar);
# RESULT: ' (null) '
This is of course quite confusing given all the different kinds of "nothingness" to figure out in Objective-C, and had me trying to test various IF NULL syntaxes.
...
Check this code..
string str;
if (str.Contains("something.."))
{
}
Compiler throws this error for this code
Use of unassigned local variable 'str'
Why does a reference type is not initialized to null ?
Just want to know out of curiosity.
I'd also want to know what happens for code below. how does this assignme...
Every now and then I come across code like this:
foo = Foo()
...
if foo.bar is not None and foo.bar.baz == 42:
shiny_happy(...)
Which seems, well, unpythonic, to me.
In Objective-C, you can send messages to nil and get nil as the answer. I've always thought that's quite handy. Of course it is possible to implement a Null pattern i...
I have a table with a DateTime column
the column can have NULL values
Now I connect to the database using an ODBC connection and get the value into a DataTable in .net / c#.
I am able to check it for NULL by going
if(String.IsNullOrEmpty(table.rows[0][0].ToString())
{
//Whatever I want to do
}
Is String.IsNullOrEmpty the correc...
I have two different queries in my php page for the same table, the first one is executed if I have two different values for two columns, but in some case, i can use only the first value, can I do it with the same query or should I use two different queries?
// query 1
"INSERT INTO my_table (column_1, column_2) VALUES ('$value_1', '$val...
Possible Duplicate:
C# okay with comparing value types to null
I was working on a windows app in a multithreaded environment and would sometimes get the exception "Invoke or BeginInvoke cannot be called on a control until the window handle has been created." So I figured that I'd just add this line of code:
if(this.Handle != nu...
Hello,
I currently have a table in MS Access called Total Registrants. How can I insert string "N/A" into the cells of the column "EventRegCompany" where there are blank cells?
I created an update query
UPDATE Test SET Test.eventRegCompany = "N/A"
WHERE (((Test.eventRegCompany)=NULL));
Thanks!
...
Hello guys,
Recently, I've been thinking if it's worth to have 1 table with perhaps a lot of NULL columns or if it's better to have more tables with no NULLs. I've heard that NULL isn't stored on InnoDB, so I was wondering if there is any downside or problem with having a bunch of rows with a lot of NULLs. I have always heard that commo...