How to override (null)?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Sorry, this can be trivial question, but somehow I cannot find the answer to
it.
When I bind a data grid to a table, then some cells show a text value
"(null)". This is happening for fields that have a database null value.
When I manually read the database I can intercept this and override the
value with a blank string, and this is the behaviour that I really want. How
can I do it when I automatically bind the grid to a source?
Thanks
 
Regular normal database table in an Access database using a Jet 4 oledb
provider.
The command that is running the query is simply this:
SELECT * FROM MyTable;
 
Cezar said:
Regular normal database table in an Access database using a Jet 4 oledb
provider.
The command that is running the query is simply this:
SELECT * FROM MyTable;

I would suggest creating an Access query with a definition like yay:
SELECT IIf(NullCol Is Null,'', NullCol) AS Whatever, NextCol FROM Table1;

Then change your command object's CommandType property to
StoredProcedure, and set the CommandText to the name you gave to the query.

It is rare that you would really want the entire contents of a table, no?
 
Back
Top