Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Hi Guys. I am trying to export data from my Access DB to a CSV file. I have managed to get this work OK, however, I want to take this one step further in that I want to only export data in the DB that have a value of '0' in the "EXPORTED" Column. I have done the below in the export code but it gives me an error.
//Write all records in the DB
foreach (DataRow dr in dt.Rows)
if (dr["Exported"] == '0')
for (int i = 0; i < iColCount; i++)
if (i < iColCount - 1)
The error I get is as follows:
"Operator '==' cannot be applied to the operands of type 'string' and 'char'
Does anybody know how I can get past this?
0 · ·