I have a Windows forms DataGridView with a combobox column. The combo box column is bound to a data source that is populated from a Linq to Entities query. I would like users to be able to select "Nothing" in the combo box (assign a value of NULL to the underlying data source).
How can I accomplish this?
...
I'm doing a bulk insert from a fixed width text file using
INSERT INTO blah
SELECT blah1, blah2
FROM OPENROWSET(BULK 'filename.txt', FORMATFILE='format.xml');
It's working fine, except that I want NULLs for the empty (all spaces) fields in the file. This is no problem for fields marked in the format file as SQLINT, SQLDATETIME, et...
Platform: Windows 7 Ultimate
IDE: Visual Studio 2010 Ultimate
Web Environment: ASP.NET MVC 2
Database: SQL Server 2008 R2 Express
Data Access: Entity Framework 4
Form Validation: DataAnnotations
Sample App: NerdDinner from Wrox Pro ASP.NET MVC 2
Book: Wrox Professional MVC 2
Problem with Chapter 1 - Section: "Integrating Validation and B...
I have a server-side script (PHP) returning JSON data to populate an ExtJS Grid.
This data comes from a MySQL query, containing some NULL values.
When PHP encodes it into the JSON notation, it keeps the NULL intact:
{"id":"33","name":"Test1","url":null,"cls":"x-tree-noicon","expanded":true}
But... when this data is displayed in the ...
Is there a way to get a column indicating the number of NULL fields in a row? This would be within a SELECT statement.
For Example:
Field1 Field2 Num_Null
-----------------------
NULL "A" 1
UPDATE: I want this query so I can sort based on how many Affiliates sales there are of a given Book. So having 3 affiliates would b...
I was kind of baffled when I saw the following code did not work as expected.
I thought Java always passed variables by references into functions. Therefore, why the function assign the variable?
public static void main(String[] args) {
String nullTest = null;
setNotNull(nullTest);
System.out.println(nullTest);
}
private st...
Guys, could any one give a logical explanation of phrase I met in this book:
You may find it helpful to think of ? extends T as containing every type in an interval bounded by the type of null below and by T above (where the type of null is a subtype of every reference type).
Thanks.
...
I have two constructors
MyObj(String s){ //first constructor
...
if(s==null) s = somecode;
this.s = s;
...
}
MyObj(): this(null) { } //second constructor
In this way, if the empty constructor is called, it will redirect to the first constructor and initialise the value as determined by some code.
However, now...
Logcat
08-17 06:37:22.264: ERROR/AndroidRuntime(1090): java.lang.RuntimeException: Unable to start activity ComponentInfo{one.two/one.two.Booking}: java.lang.NullPointerException
08-17 06:37:22.264: ERROR/AndroidRuntime(1090): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)
08-17 06:37:22.264: ERROR/And...
Hi guys, I'm trying to pull an NSUserDefaults value from a Settings.bundle into my application. When I load up the NSUserDefaults on application load, though, an NSLog reveals that my BOOL value returns "(null)" and my String value returns the number 39540360. The weird thing is that the documentation on NSUserDefaults specifically state...
I'm making my first forays into Accessing Oracle from C#. I've discovered that that Oracle doesn't like VarChar parameters to have value of null (C#). I would have hoped that there would be some implicit conversion, but I appreciate the difference.
So I need to trap these null values and supply DBNull.Value instead, surely? The most obv...
Is code that uses the static Object.Equals to check for null more robust than code that uses the == operator or regular Object.Equals? Aren't the latter two vulnerable to being overridden in such a way that checking for null doesn't work as expected (e.g. returning false when the compared value is null)?
In other words, is this:
if (Eq...
SOURCE:
javax.swing.JButton[,571,647,80x80,alignmentX=0.0,alignmentY=0.5,border=com.apple.laf.AquaButtonBorder$Toggle@1380cf2a,flags=288,maximumSize=java.awt.Dimension[width=80,height=80],minimumSize=java.awt.Dimension[width=80,height=80],preferredSize=java.awt.Dimension[width=80,height=80],defaultIcon=file:/Users/andreaks/Desktop/PreEnt...
Possible Duplicate:
In C#, should I use string.Empty or String.Empty or ?
I got the warning suggesting me to use String.Empty instead of empty string "". I can't figure out why. If you do, please share!
...
Options A:
if (NULL == pSomethingColumn) // Yes, we use Yoda conditions
if (NULL != pSomethingColumn)
Or
if (pSomethingColumn)
if (!pSomethingColumn)
I am looking for references explaining the reasoning as well.
I have heard some people say that technically NULL does not have to be defined as 0, but come on! if that was the case, ...
I am writing an ASP.Net web application. I have listview, it's datasource is a LinqDataSource. In my database, I have a staff table and I am trying filter for records by their team using a dropdownlist. This works fine, until I select "All" in the dropdownlist. It returns all staff except for the ones where the teamID is null. How c...
There is any difference in performance between the operator IS NULL and the function ISNULL() ?
...
After postback (click on a button) in my ASP.NET form, all the DataItem of my form are null. Why? What should I do to retrieve the content of the DataList even after postback?
protected void buttonAddRecord_Click(object sender, EventArgs e)
{
foreach (DataListItem item in listFields.Items)
{
// item.Data...
I recently created a tcp server in groovy and am wondering how to get it to behave similar to telnet.
For example, I run my tcp server and pull up the cmd prompt to telnet the port of the script and send it commands that its looking for. Most of the commands send back one line/word of information. However there are a few that send back ...
I'm having a problem where when I try to select the rows that have a NULL for a certain column, it returns an empty set. However, when I look at the table in phpMyAdmin, it says null for most of the rows.
My query looks something like this:
SELECT pid FROM planets WHERE userid = NULL
Empty set every time.
A lot of places said to mak...