Skip to content

Conversation

@theloginerror
Copy link
Contributor

Fixed ExecuteQuery and ExecuteNonQuery throwing an exception when trying to convert the parameter of type DBNull returned by the query:
A value of type 'System.DBNull' cannot be set to the location with name 'Argument1' because it is a location of type 'System.String'

https://uipath.atlassian.net/browse/STUD-71685

}
else
{
currentParam.Set(asyncCodeActivityContext, null);
Copy link
Collaborator

@viogroza viogroza Oct 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove the condition on else
if there is nothing to set, I would not set null; (this is a business requirement)
for example if I have a in/out param with the initial value 100, then the procedures value for the param is DbNull.. do we want to set to zero the value in this case? or let it as it was? we can use default instead of null if needed

also null assignment wouldn't work if the type is a value type (eg. integer or bool);
eg.:
object o = null;
bool v = (bool)o;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants