我正在使用SQL Server 2008 R2 Profiler调试ColdFusion 7应用程序上的问题 - 这是由其他人开发的 - 在Windows 7上运行,SQL Server 2008 R2作为后端.该应用程序最初使用MS Access 2003作为后端,后来转换为SQL Server 2008 R2.分析器显示以下使用SCOPE_IDENTITY()的SQL,但是当我使用搜索实用程序搜索应用程序根目录时,没有文件在其SQL查询中的任何位置使用SCOPE_IDENTITY()函数.该应用程序的SQL Server数据库没有任何存储过程,视图,函数等.所有SQL查询都是ColdFusion文件中的嵌入式查询.然后Profiler获得SCOPE_IDENTITY()函数:
declare @p1 int
set @p1=11
exec sp_prepexec @p1 output,N'@P1 datetimeoffset,@P2 varchar(8000),@P3 int,@P4 varchar(8000)',N'insert into ProductItems (item_date , item_description, item_type)
values (
@P1 ,
@P2 ,
@P3 ,
) select SCOPE_IDENTITY()','2015-10-19 00:00:00 +00:00','Test description',1
select @p1
Run Code Online (Sandbox Code Playgroud)
更新 虽然最初的应用程序是在CF 7中开发的,但CF 7后来升级到了CF9,现在我在具有CF 11的本地机器上进行调试.我不知道在更换CF 7时代码是否也升级了CF 8,然后是CF 9.在查询器中似乎生成上述SQL的CFquery看起来像.此外,表ProductItems确实有一个标识列,数据库没有使用任何触发器,CFquery标签没有使用结果属性:
<cfquery name="addProductItems" datasource="#dtsource#">
insert into Productitems (item_date,item_description,item_type)
values (
<cfqueryPARAM value = "#item_dat#" CFSQLType = "CF_SQL_TIMESTAMP" null="#item_dat …Run Code Online (Sandbox Code Playgroud) sql-server coldfusion sql-server-profiler scope-identity sql-server-2008-r2
在我们的带有SQL Server 2008 R2的ColdFusion 11应用程序中..cfm文件使用的CF组件使用以下语法调用:
<cfscript>
objMyTable = createobject('component','components.myTable);
qmyTable2list = objMyTable.loadAllCustomers();
qresultset = objMyTable.loadCustomersResultset(form.applicant_type, form.customer_name, form.state, form.orderby);
</cfscript>
Run Code Online (Sandbox Code Playgroud)
CF组件具有SQL语句,如下所示:
<cfquery name="result_set" dataSource="#request.dsn_name#">
select name, state from myTable #REReplace(where_clause,"''","'","ALL")#
</cfquery>
Run Code Online (Sandbox Code Playgroud)
当我们单击.cfm页面上的按钮时,应用程序正确显示来自SQL Server 2008-R2的数据.但SQL事件探查器不会捕获这些SQL语句.当我们在使用嵌入式cfquery标签进行sql查询(而不是CF组件)的.cfm页面上运行探查器时,SQL探查器会显示页面执行的所有查询. 问题:我们如何让SQL Profiler捕获CF组件内的查询?
sql-server coldfusion cfc sql-server-profiler sql-server-2008
我正在从ASP.NET站点学习本教程,当我尝试@model MovieGenreViewModel在Index.chtml视图的顶部添加时,intellisense会显示并显示MovieGenreViewModel,如下图所示.但是当我单击[或双击]时,VS编辑器只显示我手动输入的前两个字母.它不会键入(打印)整个单词MovieGenreViewModel.我正在使用最新版本ASP.NET Core 1.0 and VS2015-Update3
_ViewImports.cshtml
@using MvcMovie
@using MvcMovie.Models
@using MvcMovie.Models.AccountViewModels
@using MvcMovie.Models.ManageViewModels
@using Microsoft.AspNetCore.Identity
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
Run Code Online (Sandbox Code Playgroud)
project.json
{
"userSecretsId": "aspnet-MvcMovie-be3df79b-3899-4d3b-b5f4-69b744e8d2f2",
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0",
"type": "platform"
},
"Microsoft.AspNetCore.Authentication.Cookies": "1.0.0",
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.0",
"Microsoft.EntityFrameworkCore.SqlServer.Design": {
"version": "1.0.0",
"type": "build"
},
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.Extensions.Configuration.EnvironmentVariables": …Run Code Online (Sandbox Code Playgroud) 在这个官方的ASP.NET Core教程中,我可以使用输入标记助手,如下所示.但是由于foreach循环中表单元素的已知模型绑定问题,我想改为使用for loop.问:如果我是来取代@foreach (var item in Model)与@for (int i=0; i < Model.Count(); i++)下面View.我的意思asp-for是<input asp-for="???" />什么?出于某种原因,intellisense无法识别,例如Model [i] .BlogId或@Model [i] .BlogId
@model IEnumerable<EFGetStarted.AspNetCore.NewDb.Models.Blog>
@{
ViewBag.Title = "Blogs";
}
<h2>Blogs</h2>
<p>
<a asp-controller="Blogs" asp-action="Create">Create New</a>
</p>
<table class="table">
<tr>
<th>Id</th>
<th>Url</th>
</tr>
@foreach (var item in Model)
{
<tr>
<td>
<input asp-for="@item.BlogId" />
</td>
<td>
<input asp-for="@item.Url" />
</td>
</tr>
} …Run Code Online (Sandbox Code Playgroud) 使用锚标记助手,我们如何View在新的浏览器窗口选项卡中打开ASP.NET Core MVC .我尝试了以下但首先它抱怨target属性也需要具有href属性.但是,正如我们所知,我们不能在asp-action属性中使用href属性MVC Core; 否则我们会得到如下所示的错误.注意:我已经看到了一些类似于他的建议,但它们与标签助手无关:
<a asp-action="testAction" href="#" target="_blank">Click Here</a>
Run Code Online (Sandbox Code Playgroud)
错误:
InvalidOperationException:无法覆盖'href'属性.具有指定'href'的属性不得具有以'asp-route-'开头的属性或'asp-action','asp-controller','asp-area','asp-route','asp-protocol' ,'asp-host'或'asp-fragment'属性.
我正在一个项目中测试一个svg animation示例(取自此处的Live Example部分)。ASP.NET Core
图像显示正常。当我添加以下css 内嵌到一个特定view的动画作品,但不动画不工作时,我添加相同css的文件的site.css(默认情况下位于myProject\wwwroot\cs\site.css)。为什么?
视图[在我将相关的 css 移动到视图中后动画工作]
<div>
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="340px" height="333px" viewBox="0 0 340 333" enable-background="new 0 0 340 333" xml:space="preserve">
<path class="path" fill="#FFFFFF" stroke="#000000" stroke-width="4" stroke-miterlimit="10" d="M66.039,133.545c0,0-21-57,18-67s49-4,65,8
s30,41,53,27s66,4,58,32s-5,44,18,57s22,46,0,45s-54-40-68-16s-40,88-83,48s11-61-11-80s-79-7-70-41
C46.039,146.545,53.039,128.545,66.039,133.545z" />
</svg>
</div>
@section css{
<style>
.path {
stroke-dasharray: 1000;
stroke-dashoffset: 1000;
animation: dash 5s linear alternate infinite;
}
@@keyframes dash {
from {
stroke-dashoffset: …Run Code Online (Sandbox Code Playgroud) 环境:Windows 10 Pro - ver. 1903,VS2019 latest version,WPF Core
当我在WebView2HTML控件内显示的页面上有手动控件时,我可以通过简单地将属性添加到标记来禁用上下文菜单。但在大多数情况下,网页是根据用户交互(用户导航到哪个页面等)显示的。oncontextmunu={return false;}<body>
问题:如何禁用 WebView2 控件中显示的网页的上下文菜单?
评论:
oncontextmunu={return false;}中,也不会禁用上下文菜单。body我看到Microsoft.Web.WebView2.Core.CoreWebView2SettingsAreDefaultContextMenusEnabled类的属性,但无法识别.VS2019WebView2WebBrowser在WPF 的旧控件上也存在类似的问题,如此处和此处所述,并且 WebView2 也有类似的情况。C++但那里的解决方案似乎与我使用时有关C#。也许,还有另一种选择。在我的ASP.NET MVC 4视图中,以下内容不是调用控制器操作.Click事件会触发,因为我可以看到警报消息.但是当我在调试模式下对控制器动作设置断点时,应用程序无法达到这一点,当我在警报消息上单击"确定"时没有任何反应.我正在使用LINQ to SQL.类似的保存和插入控制器操作的调用工作正常:
$('#DeletePOC').click(function () {
if (confirm("This action will delete this POC record permanently. Click OK if you want to delete this record; otherwise, click 'Cancel'")) {
disableButton(['#CancelPOC', '#POC']);
$.ajax({
url: '@Url.Action("POCDelete")', type: "POST", dataType: "json",
data: {
SitePOCID: $('#POCId').val()
},
success: function (data) {
$('#POCStatus').html('<div class="success">POC Removed Successfully.</div>');
},
error: function () {
$('#POCStatus').html('<div class="field-validation-error">Some Error Occured in Removing POC.</div>');
}
});
}
});
Run Code Online (Sandbox Code Playgroud)
控制器:我在调试期间测试过,app没有达到这个操作方法:
[HttpPost]
public ActionResult POCDelete(int id)
{
db.POC_dsp(id);
return Json("");
}
Run Code Online (Sandbox Code Playgroud) 在下面的方法中,我收到警告:This async method lacks 'await' operators and will run synchronously.我await在哪里可以使用这个方法?注意:此方法返回一个简单的静态视图,而不与数据库等交互.
public class TestViewComponent : ViewComponent
{
public async Task<IViewComponentResult> InvokeAsync()
{
return View();
}
}
Run Code Online (Sandbox Code Playgroud) 在Step 3 - Create a Public IP本教程使用 Ansible 将 Windows VM 部署到 Azure 中,当我YAML playbook在Azure Cloud Shell. 问题:我可能缺少什么导致了这个错误,以及如何纠正它?我在网上看到了类似的问题,但它没有帮助,因为我没有犯该在线帖子中提到的错误。
create_public_ip.yaml:
---
- hosts: localhost
tasks:
- name: Create public IP address
azure_rm_publicipaddress:
resource_group: rg-cs-ansible
allocation_method: Static
name: pip-cs-web
register: output_ip_address
- name: Output public IP
debug:
msg: "The public IP is {{ output_ip_address.state.ip_address }}"
Run Code Online (Sandbox Code Playgroud)
错误:
ERROR! We were unable to read either as JSON nor YAML, these are …Run Code Online (Sandbox Code Playgroud) asp.net-core ×5
c# ×3
coldfusion ×2
razor ×2
sql-server ×2
ajax ×1
animation ×1
ansible ×1
asp.net-ajax ×1
asp.net-mvc ×1
azure ×1
cfc ×1
css ×1
jquery ×1
linq-to-sql ×1
svg ×1
tag-helpers ×1
webview2 ×1
wpf ×1