网络方法:
<WebMethod()>
Public Shared Function Pcpacking() As IEnumerable(Of Packing)
Dim db As New STOREEntities
Return db.PC_PACKING_HISTORIES. _
Where(Function(q) q.PACK_DATE > "1388/11/07"). _
Select(Function(q) New Packing _
With {.Packdate = q.PACK_DATE,
.Packserialnumber = q.PACK_SERIAL_NUMBER,
.Netweight = q.NET_WEIGHT,
.Packusername = q.PACK_USER_NAME}).ToList()
End Function
脚本:
$(function () {
$("#grid").kendoGrid({
height: 200,
columns: [
{ field: "Packserialnumber", width: "150px" },
{ field: "Netweight", width: "50px" },
{ field: "Packusername", width: "150px" },
{ field: "Packdate", width: "100px" }
],
editable: false,
dataSource: {
schema: {
data: "d",
model: {
id: "Packserialnumber",
fields: {
Packserialnumber: { editable: false, nullable: true },
Netweight: { type: "number", validation: { required: true, min: 1} },
Packusername: { validation: { required: true} },
Packdate: { validation: { required: true} }
}
}
},
batch: false,
transport: {
read: {
url: "Default.aspx/Pcpacking",
contentType: "application/json; charset=utf-8",
type: "POST"
}
}
}
});
});
在这种情况下(PACK_DATE > "1388/11/07" 366 记录)一切正常。但是当我将日期更改为 1388/11/06 1260 记录或 1388/11/05 5460 记录或...发生以下错误:
{"Message":"使用 JSON JavaScriptSerializer 进行序列化或反序列化时出错。字符串的长度超过了 maxJsonLength 属性设置的值。","StackTrace":" 在 System.Web.Script.Serialization.JavaScriptSerializer.Serialize(对象 obj、StringBuilder 输出、SerializationFormat serializationFormat)\r\n 在 System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, SerializationFormat serializationFormat)\r\n 在 System.Web.Script.Services.RestHandler.InvokeMethod(HttpContext上下文、WebServiceMethodData 方法数据、IDictionary`2 rawParams)\r\n
在 System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext 上下文,WebServiceMethodData 方法数据)”,“ExceptionType”:“System.InvalidOperationException”}
我认为剑道网格不支持大量数据。有什么建议吗?
对不起,我的英语不好。