Getting Empty DataTable

Hi,

I have cloned my Data Table and used LINQ Query to remove special characters but now I am getting empty data Table. In immediate panel getting datatable value but when doing output data table and message box its empty
image



image
image

@mkankatala

Can you help on this .This is related to the previous Regex post

@marina.dutta
datatable.Clone() will copy the schema (columns, column data type, etc) of the source data table to a new data table only.

datatable.Copy() will copy the whole source data table to a new data table. But be careful that both new and old data table shared the same address, which means when you modify a value in new/old data table, the value of the same position in another data table will be updated as well.

To copy an individual data table (deep copy), you may use below assign activity.
newDataTable = oldDataTable.AsEnumerable().CopyToDataTable

@healsko_ho

I tried but no luck. Its still giving empty datatable. What actually I am doing is ,

Copying the old DataTable into new DataTable and removing any special characters using LINQ Query below

(From r In DT1.AsEnumerable

Let ra = r.ItemArray.Select(Function (x) System.Text.RegularExpressions.Regex.Replace(x.toString,“[^a-zA-Z0-9]”,“”)).ToArray

Select dt_out.Rows.Add(ra)).CopyToDataTable()

Hi @marina.dutta

Might be huge data in the datatable which not supports to show in the Message box.
Instead of using Message box use the write line activity, it will print whole data in the output panel.

You have printed in the immediate panel right, it was working fine

Hope you understand!!

@mkankatala

Yea but it should write to Excel.

I used Write Range Workbook ,its showing Object reference not set to instance of object

In which activity you are getting this exception, If possible could you share some images… @marina.dutta

@mkankatala

image

Hey @marina.dutta

Remove the “A1” in the range field in Read range workbook activity

Hi @marina.dutta

In the cell field of write range give "A1"

In the first assign activity, you have given something wrong could you show what you have given in two assign activities… @marina.dutta

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.