小编Par*_*tha的帖子

jQuery/JSON错误"SyntaxError:JSON.parse:unexpected character"

我正在研究MVC4并尝试使用JQuery和JSON将值表单视图传递给控制器​​.该查询正在提取网格内的复选框的值.以下是代码:

<script type="text/javascript">
function DeleteCustomer() {
    var temp = "";
    var id = "";

    if (confirm("Are you sure to delete records?")) {
        $('#myGrid table tr').each(function () {
            if ($(this).find("input[id*='assignChkBx']").length > 0) {
                if ($(this).find("input[id*='assignChkBx']")[0].checked == true) {
                    temp = $(this).find("input[id*='assignChkBx']").val();
                    if (temp != "" || temp != null) {
                        id = id + " " + temp;
                        temp = "";
                    }
                } // End of Loop
            }
        }); //End of each Loop
        $.ajax({
            url: "Customer/DeleteCustomeByID",
            type: "POST",
            contentType: 'application/json; charset=utf-8', …
Run Code Online (Sandbox Code Playgroud)

asp.net jquery json asp.net-mvc-4

5
推荐指数
1
解决办法
3万
查看次数

如何在SQL Server中以十进制格式获取数字的小数部分

我试图从十进制数中得到余数.我用过的PARSENAME函数如下:

DECLARE @Total decimal(7,2) = 1000.40;
DECLARE @Remainder int = 0;

SET @Remainder = PARSENAME(@Total, 1)
Run Code Online (Sandbox Code Playgroud)

它返回小数部分的整数形式,如40.如何得到十进制形式的余数,如0.40.因为我必须将余数值存储为小数.

谢谢

帕塔

sql sql-server

2
推荐指数
1
解决办法
85
查看次数

"*"在SQL Server 2016中不起作用

我有一个用SQL Server 2000版编写的SQL查询.该查询未在SQL Server 2016中运行.查询如下所示.

Select *
from ProjPace2 P, ProjPace2 P2
where P.DivCode *= P2.DivCode
  and P.ProjGrp *= P2.ProjGrp
  and P.ProjYr *= P2.ProjYr
  and P.T_D *= P2.T_D
  and P.Qtr *= P2.Qtr
  and P.SRA_LRA *= P2.SRA_LRA
  and P.District *= P2.District
  and P.PICompany *= P2.PICompany
  and P.ContCode *= P2.ContCode
  and P.dtWkEnding > dateadd(dd,-1,'1/1/2015')
  and P2.dtWkEnding between dateadd(dd,-10,'1/1/2015') and dateadd(dd,-3,'1/1/2015')
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

消息4147,级别15,状态1,行20
查询使用非ANSI外部联接运算符("*="或"=*").要在不进行修改的情况下运行此查询,请使用ALTER DATABASE的SET COMPATIBILITY_LEVEL选项将当前数据库的兼容级别设置为80.强烈建议使用ANSI外连接运算符(LEFT OUTER JOIN,RIGHT OUTER JOIN)重写查询.在SQL Server的未来版本中,即使在向后兼容模式下也不支持非ANSI连接运算符.

我可以理解由于"*"而发生的错误,我想用Left outer join替换它,所以我可以得到相同的结果.

谢天谢地,任何帮助都会被接受.

帕塔

sql sql-server join

1
推荐指数
1
解决办法
225
查看次数

无法隐式转换类型'System.Collections.Generic.List <>'

我正在使用VS 2017来开发我的.NET应用程序.我编写了以下代码来从api中的表中检索数据

[HttpGet]
[Route("Index")]
public IEnumerable<Strings> Index()
{
    var list = db.Strings.Select(x => new { x.Iid, x.Value, x.Description, x.Itype }).ToList();
    return list;
}
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

错误CS0266无法将类型'System.Collections.Generic.List <>'隐式转换为'System.Collections.Generic.IEnumerable'.存在显式转换(您是否错过了演员?)**

如何铸造是可能的?我已将IEnumerable更改为IList但问题仍然存在.我不想为此创建ViewModel.

c# linq asp.net-web-api

-3
推荐指数
1
解决办法
3181
查看次数

标签 统计

sql ×2

sql-server ×2

asp.net ×1

asp.net-mvc-4 ×1

asp.net-web-api ×1

c# ×1

join ×1

jquery ×1

json ×1

linq ×1