Hi,
I am trying to use dataview(myDataTable).toTable(false, selectColNames}
where selectColNames is a string array, which has column names with special characters like %, ’ in it. For example “% Score”, “Resource’s Phone”. I am getting other columns if I do not include columns with special characters. Escaping the special characters is not helping like “% Score”. Can you please help?
Thank you,
I get System.ArgumentException.
At the first special character in the column name, in the above example ‘%Score’ does not belong to underlying Table.
If I remove ‘%score’ then I get this exception “Resource’s Phone” does not belong to underlying Table.
First if you want to change the columnname then we can use a assign activity like this
datatable.Columns(0).ColumnName = “any new name”
This can’t be done with DefaultView method
Then if you would like to get only certain number of columns from a datarable with multiple columns then we can use a DefaultView method like this
dt = dt.DefaultView.ToTable(False, columnarray)
And finally if you are getting this error
Make sure you don’t have same column names in that DATATABLE itself or make sure the column name is same as in DATATABLE
Finally if you want to delete just one or two columns from the main DATATABLE and get the remaining
Then you can directly use REMOVE DATACOLUMN activity