Add data row in a specific colum

Hi,

I want to add data in a specific column of my database. I have 4 columns

ID (Int32), FirstName (String), middle name (String), LastName (String),

I tried to add the middle names by “Add Data Row”
{“”,“”,middlename,“”}

what am I doing wrong?

I have this error in log messages:
Add Data Row: Input string was not in a correct format.Couldn’t store <> in id Column. Expected type is Int32.

Thank you so much

2 Likes

Hi @jotastorres

If you want to add a row under a specific column use this

Drag a assign activity
Datatable.Rows.Item(“Column Name”) = value —>Mean What you want to add under the specific column

or

If your using for each row inside the do add the assign activity

row.Item(“column name”) = Value

In your case

row.Item(“Middle name”)=middle names

Regards,
gulshiyaa

3 Likes

For number type (integer type) no need to provide double quotes because it is not a string type.

2 Likes

Hi, it doen’t work. I don’t know if it is because I use a “for each item”

log Error

“db.rows.item(“middlename”)”.
Option Strict On disallows implicit conversions from ‘String’ to ‘Integer’.

Dont put “” on outside only use db.row.item(“middlename”)

2 Likes

why are you using for each item?
its not for each item
see first you will read your excel and keep it as db
then if you want to add one value to that particular column then use db.Rows.Item(“columnname”)=value here item is not a for each item its a function called Item this will be in capital

1 Like

@jotastorres instead of passing integer data type, u are passing string data type to ID field, so it’s throwing an exception.
Remove the “” (double quote) for ID in add data row activity. instead of keeping blank space write noting(means empty value)
It may helpful for u.
image

4 Likes

Thank you. It works for me

1 Like

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