如果运行下面的代码,就会出现一个错误:通知选项标识符中,选项与选项之间必须用分号(;)分隔。但发现某选项后面是字符串 '='。
if (Register)
{
// Create and bind the SqlNotificationRequest object
// to the command object.
SqlNotificationRequest request =
new SqlNotificationRequest();
request.UserData = new Guid().ToString();
request.Options = String.Format(
"Service={0};local database={1}",
ServiceName, DatabaseName);
// If a time-out occurs, a notification
// will indicating that is the
// reason for the notification.
request.Timeout = NotificationTimeout;
command.Notification = request;
}