我有以下查询:
UPDATE TOP (@MaxRecords) Messages
SET status = 'P'
OUTPUT inserted.*
FROM Messages
where Status = 'N'
and InsertDate >= GETDATE()
Run Code Online (Sandbox Code Playgroud)
在Messages表中有优先级列,我想首先选择高优先级消息.所以我需要一个ORDER BY.但是我不需要在更新运行之前对输出进行排序,而是对数据进行排序.
据我所知,不可能将ORDER BY添加到UPDATE语句中.还有其他想法吗?
米
我已将我的第一个穿戴应用程序发布到 Play 商店的内部测试轨道。该应用程序依赖于移动应用程序,我使用 Multi APK 在一个版本中部署这两个 apk。
我可以在 Google Play 中看到该移动应用并进行搜索。在手表上,我无法在 Google Play 中找到我的应用程序。直接链接(可从选择加入 URL 获取)工作正常,我可以安装我的应用程序。
此外,当我安装移动应用程序时,我的手表上没有收到任何通知(请参阅https://developer.android.com/training/wearables/apps/packaging): “在运行 Wear 2.0 的设备上,当用户安装手机时如果应用程序具有关联的手表应用程序(嵌入式 APK 或通过 Play 管理中心上传的 APK),则用户会收到有关可用手表应用程序的手表通知”
我知道在佩戴时显示对话框的推荐方法是使用 AlertDialog (https://developer.android.com/training/wearables/ui/),但默认情况下 AlertDialog 在圆形屏幕上看起来不太好。我知道我必须提供自定义布局(请参阅显示 Android Wear 样式 AlertDialog),但是我必须使用自定义颜色和图像(即可绘制/ic_tick)。
是否有适用于 Wear 的默认对话框布局,或者可能有更好的方法在 Wear OS 上使用 AlertDialog?
我正在尝试使用 Google Cloud Scheduler 将推送发送到我的应用程序:
gcloud beta scheduler jobs create http PUSH --schedule="0 * * * *" --uri="https://fcm.googleapis.com/fcm/send" --description="desc" --headers="Authorization: key=<AUTHKEY> --http-method="POST" --message-body="{\"to\":\"/topics/allDevices\",\"priority\":\"low\",\"data\":{\"success\":\"ok\"}}"
Run Code Online (Sandbox Code Playgroud)
结果总是401 Unauthorized。发出命令后:
gcloud beta scheduler jobs describe PUSH
Run Code Online (Sandbox Code Playgroud)
我没有得到这些标头:
description: desc
httpTarget:
body: eyJ0byI6Ii90b3BpY3MvYWxsnByaW9yaXR5IjoRGV2aWNlcyIsIiaGlnaCIsImRhdGEiOnsic3VjY2VzcyI6Im9rIn19 <--- THIS IS WEIRD
headers:
Content-Type: application/octet-stream
User-Agent: Google-Cloud-Scheduler
httpMethod: POST
uri: https://fcm.googleapis.com/fcm/send
lastAttemptTime: '2018-11-07T20:32:37.657408Z'
name: projects/..../locations/europe-west1/jobs/PUSH
retryConfig:
maxBackoffDuration: 3600s
maxDoublings: 16
maxRetryDuration: 0s
minBackoffDuration: 5s
schedule: 0 * * * *
scheduleTime: '2018-11-07T21:00:00.681498Z'
state: ENABLED
status:
code: 16
timeZone: Etc/UTC
userUpdateTime: '2018-11-07T20:29:15Z'
Run Code Online (Sandbox Code Playgroud) 我需要一种方法来唯一标识android和iOS设备,即使在卸载并重新安装我的应用程序之后也是如此。ANDROID_ID和UUID均不执行该工作。也许有一些专门用于此任务的库?
我的EditorFor(DateTime)函数有问题.我有一个这样定义的模型:
[MetadataType(typeof(MessageSearchDTO_Validation))]
public class MessageSearchDTO
{
public DateTime StartDate { get; set; }
public DateTime EndDate { get; set; }
}
public class MessageSearchDTO_Validation
{
[DisplayName("Od")]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd HH:mm}")]
[Required(ErrorMessage = ErrorMessages.FieldRequired)]
public DateTime StartDate { get; set; }
[DisplayName("Do")]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd HH:mm}")]
[CustomValidation(typeof(MessageSearchDTO_Validation), "EndDate_CustomValidator")]
[Required(ErrorMessage = ErrorMessages.FieldRequired)]
public DateTime EndDate { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
问题是我想要一个带时间编辑器的完整日期.但它仅适用于Chrome.在FF/IE中我得到了这个javascript验证错误.如果我设置"10/23/2013 12:00:00 AM"的值,它可以正常工作.但是我如何强制我想要的日期时间格式呢?
我甚至试图实现自定义绑定器,它没有工作,因为这是客户端错误...
我在我的 Asp.Net core 应用程序中配置了 Facebook Login(根据https://learn.microsoft.com/en-us/aspnet/core/security/authentication/social/facebook-logins?view=aspnetcore-2.2) - 有效就像 localost 上的魅力一样。
但是,当我在 Azure 上部署应用程序时,出现此错误(单击 facebook 按钮并从 facebook 重定向到 https://.azurewebsites.net/signin-facebook?code=xxx 后:
System.Exception: An error was encountered while handling the remote login. ---> System.Exception: OAuth token endpoint failure: Status: BadRequest;Headers: Vary: Accept-Encoding
WWW-Authenticate: OAuth "Facebook Platform" "redirect_uri_mismatch" "Can't Load URL: The domain of this URL isn't included in the app's domains. To be able to load this URL, add all domains and subdomains of your app to the App Domains field …
Run Code Online (Sandbox Code Playgroud)