- I am fetching a data data base, i need to add one column “Date”,
- datarows will be dynamic, so for all the data rows i need to add todays date under a Date column
Database datatable
What I am Expecting
Thanks.
Database datatable
What I am Expecting
Thanks.
Hi @ManjunathReddy
NewProcess.zip (172.8 KB)
Hi @ManjunathReddy ,
You can try add data column
=> Use the Use excel file activity and pass the excel path.
=> Inside Use excel file activity place the Insert column activity. Insert the Column “Date”
=> After Insert column activity place the For each excel row to iterate the rows in the excel.
=> Inside for each place the assign activity to store the now datetime in a variable
- Assign → TodayDate = Now.Date.toString(“dd-MM-yyyy”)
=> After the assign activity place the write cell activity to write the TodayDate variable in to the all rows in date column.
→ In the where to write field give the CurrentRow.ByField(“Column name”)
Check the below workflow for better understanding
Hope it helps!!
dtData
dtData = (From row In dtData.AsEnumerable()
Let newRow = row.ItemArray.Append(DateTime.Now.ToString("dd-MM-yy")).ToArray()
Select dtData.Rows.Add(newRow)).CopyToDataTable()
Hope it helps.
UpdatedDT = For Each row As DataRow In dtData.Rows
row(“ColumnName”) = DateTime.Now.ToString(“dd-MM-yyyy”)
Next
@ManjunathReddy
I have specified the position of the column using the method setOrdinal in the invoke method activity:
The DataColumn.SetOrdinal(Int32) method changes the ordinal or position of the DataColumn to the specified ordinal or position.
When you change a column’s ordinal, the column is moved to the new position in the collection of columns. Any columns between the previous and new ordinal will be renumbered, to adjust for a column’s new ordinal.
Changes the ordinal or position of the DataColumn to the specified ordinal or position.
@ManjunathReddy
we can’t add column specific position but after adding column we can change their position through Invoke Method
@ManjunathReddy If your problem solved, please mark it as a solution
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.