Hi, How to convert from String/Int to DataRow type.
Fine
to convert as string
String.Join(“,”,datarow.ItemArray())
to convert as int32
Convert.ToInt32(String.Join(“”,datarow.ItemArray()))
Cheers @balkishan
I already have the String and Integer variable just I want to convert into DataRow variable.
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
sorry, I made a mistake while writing.
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.
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
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
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
Hi @Palaniyappan, think we cannot pass a string to a data row By using Add Data Row
as said below, Cause the same Data Table cannot accept adding Same Data Table Row.
Correct me if I’m wrong
This actually returns a data of type Datarow and not string. So that would work
Cheers @Sun_Dar
Why? It’s probably not necessary.
f1(0).ToString