使用jQuery和asp.net web的服务从SQL Server数据加载 [英] Loading Data from SQL Server using jQuery and asp.net web-services

查看:97
本文介绍了使用jQuery和asp.net web的服务从SQL Server数据加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要SQL数据加载到一个jQuery插件图表

I want to load SQL data into a jQuery Graph plugin

我已阅读:

通过我的研究,大家都说直接连接到从jQuery的SQL Server的。获得方法是不安全的。有什么建议是,你而是来自服务器端语言连接到数据库,如asp.net。

Through out my research, everyone says that connecting directly to SQL Server from jQuery .get method is unsafe. What was suggested was that you rather connect to the database from a server side language such as asp.net.

我的问题:

难道是安全的,然后创建一个连接到数据库并获取数据,然后通过jQuery连接到Web服务的Web服务?

Would it be safer then to create a web service that connects to the database and retrieves the data and then connect to that web service via jQuery?

感谢

推荐答案

答案肯定是,创建一个Web服务(或ASP.NET API)是远远更安全。如果从jQuery的连接,则:

The answer is definitely that creating a web service (or ASP.NET API) is far, far safer. If you connect from the jquery then:


  • 查询源自用户的浏览器

  • 这意味着,无论是

    • 用户在同一个域,并给予直接访问

    • 网页必须包含一个SQL登录名和密码,可见查看
      来源

    • 无论哪种方式,用户,还是很容易的工作如何,直接访问你的数据库

    • 如果这不是您的Intranet上,你的数据库可能暴露于每一个网络用户在世界

    通常,这被看作是pretty不安全的。

    Generally this is seen as pretty insecure.

    这篇关于使用jQuery和asp.net web的服务从SQL Server数据加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆