如何运行一个Web服务器,该服务器调用SQL Server数据库吁请AngularJS [英] How to run AngularJS on a web Server which invokes SQL Server Database Calls

查看:94
本文介绍了如何运行一个Web服务器,该服务器调用SQL Server数据库吁请AngularJS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建设我的第一个应用程序与.NET。

I'm building my first Angular application with .NET.

我用 VS 2012 C# SQL Server 2012中

我真的很兴奋这个,但尽管教程和文档提供的几乎令人生畏的量,我无法找到如何从SQL Server检索的数据,并在我的应用程序显示它明确的解释。

I'm really excited about this but, despite the almost daunting amount of tutorials and docs available, I can't find a clear explanation of how to retrieve the data from SQL server and display it in my app.

我已经玩了一下周围有丹Wahlin的客户经理应用,但这是建立与实体框架 BreezeJS ,这两者都是新的给我。

I have been playing around a bit with Dan Wahlin's Customer Manager app, but this is built with Entity Framework and BreezeJS, which are both new to me.

我也试图按照这个code项目这通过标准的Web服务建立与服务器的通信和看起来像一个 AJAX 调用来检索某些 JSON

I have also tried to follow this Code Project which builds communication with the server via a standard web service and what looks like an ajax call to retrieve some json.

但没有服务器端code反序列化SQL成JSON(我假设是必要的)。

However there is no server side code to deserialize the SQL into Json (which I assume is necessary).

这是我想什么:


  • 如何到我的角度应用程序连接到SQL Server数据库的例子。

  • 的例子应该提到参与实现这一步骤。

我不期望的所有的这样做的可能的方式,我不要求你为我做一个COM prehensive列表。

I don't expect a comprehensive list of all the possible ways of doing this and I'm not asking you to do it for me.

我只希望换一种方式不够好,让我开始。

I'm just hoping for a way good enough to get me started.

非常感谢你。

推荐答案

有不同的方式连接到使用.NET SQL Server数据库,并将其投放到具有AngularJS构建的Web应用程序数量。

There are number of different ways to connect to a SQL Server database with .NET and serve it to a web application built with AngularJS.

要开始,我推荐使用实体框架连接到SQL Server数据库,并使用Web API服务数据2.下面是微软对这个话题提供了一个教程

To get started, I'd recommend using Entity Framework to connect to your SQL Server database and serve the data with Web API 2. Here's a tutorial provided by Microsoft on this topic

http://www.asp.net/web-api/overview/data/using-web-api-with-entity-framework/part-1

一旦你有一个可用的Web服务,你就可以使用 $ HTTP $资源在AngularJS服务,从网络服务中获取数据。

Once you have a web service available, you'll be able to use the $http or $resource services in AngularJS to get data from that web service.

至于其他方面,你可以连接到与其他.NET数据访问技术,如NHibernate的,短小精悍,ADO.NET SQL Server数据库。并且你可以通过与其他技术,如WCF,ServiceStack或ASMX Web服务服务的数据。你甚至可以使用non-.NET Web服务器技术来连接到SQL Server数据库,如果你真的想。例如,有一个MSSQL包node.js的。

As for the other ways, you can connect to a SQL Server database with other .NET data access technologies such as NHibernate, Dapper, ADO.NET. And you can serve that data via a web service with other technologies like WCF, ServiceStack or ASMX. And you can even use non-.NET web server technologies to connect to a SQL Server database if you really want to. For example, there's an mssql package for node.js.

这篇关于如何运行一个Web服务器,该服务器调用SQL Server数据库吁请AngularJS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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