I want to check a single row of datatable having empty fields.
Suppose In 1st row want to check to which columns are empty by name.
How can I Do that.
Hi @amarjeet_kumar,
In my example, when a specific column header doesnât contain a name, it basically comes with âColumnâ and a number in its name, for example, in my excel file the empty column header was renamed to âColumn1â in the datatable. Kindly check the attached example.
example.zip (7.8 KB)
I do not believe that the previous answer is correct.
In my example I have looped through each of the data columns in the table using DataColumn as the object. You are then able to reference the column name. You will see that any blank column headers are automatically entitled âColumn1â and would increment accordingly e.g. Column2, Column3 - you could then use these columns to rename or delete as required.
Here is a link to the online solution and the xaml file and test.csv document are attached.
http://stackoverflow.com/questions/6791894/in-vb-net-how-to-get-the-column-names-from-a-datatable
Checking Empty Columns.zip (1.8 KB)
Richard