简体   繁体   English

jQuery 带有存储过程的数据表

[英]jQuery Datatables with Stored Procedure

I am trying the jQuery datatables and its pretty amazing.我正在尝试 jQuery 数据表,它非常棒。 What I need to do however is get data from a stored procedure (SQL Server 2012) which accepts a parameter.但是,我需要做的是从接受参数的存储过程(SQL Server 2012)中获取数据。 What are the options here?这里有哪些选择? Do I have to build a web service to get the data or is it possible without creating a service layer?我是否必须构建 web 服务才能获取数据,或者是否可以不创建服务层?

Also I am unable to find an example that uses SP with parameters?我也找不到使用带参数的 SP 的示例? If anyone has an example please share it with me.如果有人有例子,请与我分享。

No, a web service is not obligatory.不,web 服务不是强制性的。 Refer: Web service vs Direct connection to DB参考: Web service vs Direct connection to DB

If you have control over the SQL server, options of using the JSON/CSV format as acceptable to data-tables is always there.如果您可以控制 SQL 服务器,则始终存在使用 JSON/CSV 格式作为数据表可接受的选项。 Check Data Sources for Datatables .检查数据表的数据源

Avoid cross-origin error while trying to access local files (maintain directory structure ie parent/origin/target file paths).尝试访问本地文件时避免跨域错误(维护目录结构,即父/源/目标文件路径)。 Refer Cross origins and local file access by Firefox参考Firefox 的跨域和本地文件访问

Hope some of it helps希望其中一些有帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM