Jquery / JSON中的数据库连接 [英] DB Connection in Jquery / JSON
本文介绍了Jquery / JSON中的数据库连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的朋友们,
我需要执行查询并填写下拉列表框中的值。
我需要在JQuery或JSON不在C#结尾。
任何人都可以指导我这个。
Dear Friends,
I need to execute a query and fill the value in Dropdownlist box.
I need to do this in JQuery or JSON not in C# end.
Can any one guide me on this please.
推荐答案
你无法连接到数据库jQuery
。
所以,按C#WebMethod > jQuery
并连接到数据库。
然后返回一个包含所有选项的对象,然后在客户端绑定。
You can't connect to Database withjQuery
.
So, call one C# WebMethod byjQuery
and connect to Database.
Then return one object containing all the options and then bind at client side.
jQuery( JavaScript)无法连接到传统意义上的MySQL,SQL Server等数据库*。
您必须在服务器上运行脚本(在PHP中) ,ASP.NET等,连接并查询数据库,然后通过HTTP将其返回到客户端脚本,通常采用JSON,XML,CSV或其他基于文本的序列化格式。
*有一些S的端口QLite到javascript,可能值得研究,但更有可能适用于服务器端脚本,例如node.js。
jQuery (JavaScript) cannot connect to a database such as MySQL, SQL Server, etc. in the traditional sense*.
You must have a script running on the server (in PHP, ASP.NET, etc.) that connects to and queries the database and then returns it to your client-side script over HTTP, usually in JSON, XML, CSV, or another text-based serialization format.
* There have been some ports of SQLite to javascript, which may be worth researching, but more likely are suited to server-side scripting such as in node.js.
这篇关于Jquery / JSON中的数据库连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文