Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Have you been wondering how to use DateTime inside of SqlFilters, with your Topics/Subscriptions? Have you also noticed that this doesn't seem to work?
var message = new BrokeredMessage();
message.Properties["datetime"] = DateTime.Now;
var sqlFilter = new SqlFilter("datetime > '2016-06-06'");
That's because you explicitly need to add the DateTime as a parameter, like so:
var filter = new SqlFilter(" datetime >= @datetime");
filter.Parameters.Add("@datetime", DateTime.Parse("2016-06-06"));
In order to make this more searchable in the future, I have also added a corresponding StackOverflow question: https://stackoverflow.com/questions/37705333/azure-service-bus-using-datetime-in-topic-subscription-sqlfilter-in-net
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in