You can just set the datacolumn value to 0, for instance
DataTableName.Rows[0][ColumnIndex] = 0;
http://msdn.microsoft.com/library/de...classtopic.asp
If you mean that when you create a new row that it defaults to 0 instead of
dbnull, then you can set the DefaultValue property of the datacolumn
http://www.knowdotnet.com/articles/types.html
DataColumnName.DefaultValue = 0;
If you are talking about a dataGrid and want DbNull values to be reflected
as 0's instead of the literal null, then add a DataGridTableStyle, afterward
add a DataGridColumnStyle and set the rows DefaultValue property to 0.
http://www.knowdotnet.com/articles/kdngrid.html
Since you mention null instead of DbNull (which is what the value will come
back as) I thought this might be what you were referencing.
--
W.G. Ryan MVP Windows - Embedded
www.devbuzz.com www.knowdotnet.com http://www.msmvps.com/williamryan/
"Vicky" <vi***@hh.com> wrote in message
news:eG**************@TK2MSFTNGP11.phx.gbl...
What is the best way of converting Null value in datatable numeric column
to 0.
THanks