Conversion From Int/String to DataRow type var

Hi, How to convert from String/Int to DataRow type.

@HareeshMR @indra

2 Likes

Fine
to convert as string
String.Join(",",datarow.ItemArray())
to convert as int32
Convert.ToInt32(String.Join("",datarow.ItemArray()))

Cheers @balkishan

2 Likes

I already have the String and Integer variable just I want to convert into DataRow variable.

1 Like

but the question was like this buddy
no worries
to convert a string or integer as datarow
we can use ADD DATA ROW ACTIVITY where we can pass the string or int32 as a array of string or array of int32 and mention the datatable dt so that it will get added to the table as well

Cheers @balkishan

1 Like

sorry, I made a mistake while writing.

1 Like

no worries buddy
is it working
kindly let know if we are facing any issue
Cheers @balkishan

Why are we using Add Data Row Activity, We need to convert from String and Int into DataRow.
image

1 Like

Fine
we need to mention it as
{RowCount.ToString}
and type argument as string in the property panel of add data row activity and this is the activity used to pass a string or int32 or array or list of values to a datatable as a datarow

Cheers @balkishan

1 Like

Sorry I am not getting it, then where is the conversion bro.
Then how it will convert the type from Integer into DataRow.

2nd que. Here I don’t want to use the Add Data Row

1 Like

Great
we need to have a string array or int array
–so we need to pass those string or int32 to a array
–now to convert that array to a datarow unless we use DATATABLE class we wont be able to convert that arrayrow as a datarow
–so for that
datatable.Rows.Add(arrayvariable)

or to make it more easier with a activity
we can use ADD DATAROW activity where we need to mention only one argument like either arrayrow or datarow
–where arrayrow can be mentioned like this {“value1”,“value2”} or with a array variable
–where in datarow we can pass like this datatablename.Row(rowindex)
and in datatable mention the datatable name

its more like the above method thats why suggested to use this activity
and type argument must be mentioned either like string or int32 or based on the element type in array row property of add datarow activity

hope this wuld help you
Cheers @balkishan