|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to override (null)?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 Cezar wrote:
> When I bind a data grid to a table, then some cells show a text value What kind of "table" are you binding to?> "(null)". 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; Show quote "Brad Wood" wrote: > Cezar wrote: > > When I bind a data grid to a table, then some cells show a text value > > "(null)". > > What kind of "table" are you binding to? > Cezar wrote:
> Regular normal database table in an Access database using a Jet 4 oledb I would suggest creating an Access query with a definition like yay:> provider. > The command that is running the query is simply this: > SELECT * FROM MyTable; 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? |
|||||||||||||||||||||||