Here is how to do with just a simple SQL statement...
SELECT title_id, type, advance
FROM pubs.dbo.titles
WHERE advance IS NULL
or:
SELECT CustomerID, CompanyName, Region
FROM Northwind.dbo.Customers
WHERE Region = NULL
For details see:
http://www.schemamania.org/jkl/booksonline/SQLBOL70/html/8_qd_06_5.htm
or:
http://doc.ddart.net/mssql/sql2000/html/acdata/ac_8_qd_06_7xir.htm
And here for records already contained inside a DataSet/DataTable...
You can query if a DataRow field has an empty value by...
DataRow dr = ...get row...
if (dr["ColumnName"] == DbNull.Value)
{
//then field is null, do whatever you want with it, such as set as a
new value...
dr["ColumnName"] = ... some new value ...
}
--
Michael Lang, MCSD
See my .NET open source projects
http://sourceforge.net/projects/dbobjecter (a code Generator)
http://sourceforge.net/projects/genadonet (Generic ADO.NET)
Dino M. Buljubasic said:
How can I update fields with a colum as NULL value in VB.net
Something like this:
UPDATE table1
SET colMycolumn = 22
WHERE aCol = NULL
Thank you,