P-A-J
(P)
1
i am using a assign to a DataRow variable.
dtTable2.Select(“Emp Id=”+SelectRows(“ID”).ToString)(0)
this is giving me error , saying “Assign: Syntax error: Missing operand after ‘Id’ operator”
The expression “SelectRows(“ID”).ToString” is giving a number i.e ID , so is this issue because of space ?
Parvathy
(PS Parvathy)
2
Hi @P-A-J
Try this:
Assign Activity:
selectedRows = dtTable2.Select("Emp Id = '" + SelectRows("ID").ToString + "'")
Regards,
@P-A-J
Use this
Assign Activity:
yourvariable= dtTable2.Select(“Emp Id = '” + SelectRows(“ID”).ToString + “'”)
mkankatala
(Mahesh Kankatala)
4
Hi @P-A-J
Try with the below expression
dtTable2.Select("[Emp Id] = " + SelectRows("ID").ToString)(0)
Hope it helps!!
postwick
(Paul)
5
This is where you need to think about the resulting string after the variables are replaced.
dtTable2.Select(“Emp Id=”+SelectRows(“ID”).ToString)(0)
Now take "+SelectRows(“ID”).ToString and replace it with the value "ID " and you get…
dtTable2.Select(“Emp Id=ID ")(0)
The problem should now be obvious.
String values need to be inside single quotes in a where clause.
dtTable2.Select(“Emp Id='ID '")(0)
postwick
(Paul)
7
You also have to put Emp Id inside brackets.
dtTable2.Select(“[Emp Id]=‘”+SelectRows(“ID”).ToString + "’")(0)
1 Like
lrtetala
(Lakshman Reddy)
9
Hi @P-A-J
Try this
dtTable2.Select("[Emp Id] = '" + SelectRows("ID").ToString + "'")(0)
system
(system)
Closed
10
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.