i have an excel where four column presents mrp,price,discount,rating. i want to do if empty data presents in mrp,price, discount. then i want to copy the whole row and write this empty data contains row in excel how can i do this?
Can you share a sample data file?
tst.xlsx (8.3 KB)
here i want to copy the whole row of product id-ASD0025, ASD0027 and write it in an excel then remove this two from the main excel sheet…because ASD0025 contains blank in sale price, discount field and ASD0027 contains alphabate in mrp,sales_price and discount column.
You can use a linq here assuming your datatable name is dt
dt1=(from dr as datarow in dt where dr.item("mrp").tostring.equals("") or dr.item("price").tostring.equals("") or dr.item("discount").tostring.equals("") select dr).copytodatatable()
Hope this helps you.