SmartConnector Forum
Schneider Electric support forum about SmartConnector applications for integration of other building management systems (BMS) into EcoStruxure Building Operation.
Link copied. Please paste this link to share this article on your social media post.
Hi,
Is there a way to set the State property of all ValueItems in one shot?
We would like doing it in one shot instead of looping through all value items. The ValueItems belong to an EWS server.
Thank you.
Mike
Link copied. Please paste this link to share this article on your social media post.
Hi Michael,
If we are talking about a single batch call to the SQL database, the best way I can see to do this will be like in the pseudo code below.
myEwsServerDataAdapter.AutoCommit = false;
foreach (var valueItem in myEwsServerDataAdapter.ValueItems)
{
valueItem.State = TheStateYouWannaSet
}
myEwsServerDataAdapter.CommitChanges();
myEwsServerDataAdapter.AutoCommit = true;
Best Regards,
-Jeff
Link copied. Please paste this link to share this article on your social media post.
Hi Michael,
If we are talking about a single batch call to the SQL database, the best way I can see to do this will be like in the pseudo code below.
myEwsServerDataAdapter.AutoCommit = false;
foreach (var valueItem in myEwsServerDataAdapter.ValueItems)
{
valueItem.State = TheStateYouWannaSet
}
myEwsServerDataAdapter.CommitChanges();
myEwsServerDataAdapter.AutoCommit = true;
Best Regards,
-Jeff
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.