My data table filled from db is having empty values in some cells.
The results database SP return has Null in them but in DataTable these values are appearing as '' or empty cells.
Please guide me how to use Select() to select these dbnull/ empty rows.
Thanks
Below is the syntax to filter the rows without a null value in a specified column. Syntax: SELECT * FROM <table_name> WHERE <column_name> IS NOT NULL; Example: SELECT * FROM demo_orders WHERE ORDER_DATE IS NOT NULL; --Will output the rows consisting of non null order_date values.
If a DataTable is null then you can't copy anything to it: there isn't anything to copy into!
The correct way to check for null is to check for it:
DataRow[] myResultSet = myDataTable.Select("[COLUMN NAME] is null");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With