What is AngularJS SQL

 

 

Sometimes, we need to display information on the web page dynamically. There may be the cases when data is being collected on regular or irregular intervals. In those situations, data is fetched from third party locations in form of interoperable notations using exposed services.

Now the question is “Does AngularJS support this feature and can it help us to give solution in this case?”

The answer is YES!

Data source is situated at remote location to our AngularJS application. So we need a language or special notion which can be transmited and understood by AngularJS.

That special light weighted notation is JAVA SCRIPT OBJECT NOTATION (JSON). Remote web service returns data in JSON formation, which is consumed and post compilation it is used by AngularJS application.

Hence AngularJS is perfect to display data from database provided data should be in JSON format. As AngularJS is JavaScript based framework, it works for PHP, ASP.Net and many more…

In this article, we are considering ASP.NET for demonstration.

Assume it that we have a table in SQL Server with data which is represented below:

Data Source

Location Country
Delhi India
New York USA

We need a web service which provides above data in JSON format. Let’s say:

Web Service

http://hostname/locations.aspx

It returns data in JSON format as below:

{“records”:[ { “Location” : “Delhi”, “Country” : “India” }, { “Location” : “New York”, “Country” : “USA” } ]}

Above mentioned URL can be used in AngularJS application using AngularJS service $http.

AngularJS Application

Output

Delhi India
New York USA

 

Let’s see, how is the code of locations.aspx written?

 

Be  Connected…

Satyendra Mishra

 

THREE QUERIES offers easy access to information about SharePoint and associated technologies, project management, agile and scrum methodologies that helps developers, administrators, architects, technical managers, business analysts and end users. It has grown from there. We provide an important knowledge base for those involved in managing, architecture and developing software projects of all kinds. With weekly/daily exclusive updates, we keep you in touch with the latest business, management, technology thinking.

WE ARE CONNECTED ~ Follow us on social media to get regular updates and opinion on what's happening in the world of SharePoint, front-end, back end web technologies and project management. If you like this article, please share it and follow us at Facebook, Twitter, Instagram, Pinterest and LinkedIn

,

About Satyendra Mishra

Microsoft certified, motivated, energetic and accomplished SharePoint Consultant and Architect with 13+ years of work experience in Management, Architecture, Analytics, Development and Maintenance. He has been fortunate to be a part of over 20+ Web/Mobile/Software SharePoint and .Net projects delivery with various companies across different industry sectors. This has provided him a valuable insight and experience especially in successful implementation of technology solutions. Having very strong System Architecture, Technological, Management & Analytical Skills, Knowledge of Office 365, SharePoint, .Net, JavaScript, React, Angular, Azure, SQL. In 2016, he decided to start sharing the knowledge back to society in the form for content writing and blogging.
View all posts by Satyendra Mishra →

Leave a Reply

Your email address will not be published. Required fields are marked *