All I want is a value
I'm no .NET programmer, but some of you are.
I'm in Workflow Designer and I've got a DataTable named dtQuads. Don't worry about how I got it. I've got an If activity. Inside the the Then option I have a Sequence. The first item in the Sequence is an Assign activity. On the left I have a string variable called sObjectIDs. On the right I have dtQuads.Rows[0]["QUAD"]. Workflow is complaining about this at design-time. I hover over the red exclamation mark and it says "End of expression expected." I have verified that there are no extra punctuation marks. How, then should I get the value of a string field from the first row in a DataTable. Any help would be appreciated.
-
Hi Roger,
Inside the workflow designer you need to use VB syntax, not c#. So it should be parenthesis not square brackets.
Try: dtQuads.Rows(0)("QUAD")
Cheers,
Christian.
0 -
I'll have to remember that. But now I have a new error:
"Cannot assign from type 'System.Object' to 'System.String' in Assign activity 'Assign'
Do I have to use a Cast<T> activity, or can I do it in-place?
0 -
Try following that up with a .toString :
dtQuads.Rows(0)("QUAD").toString()
0 -
If there is ever a risk of the value being null, you can also wrap it all up in a String.Format call:
String.Format("{0}", dtQuads.Rows(0)("QUAD"))0 -
I did end up using the Cast<String> activity and that worked just fine. Thank you for your assistance this afternoon.
0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
5 kommentarer