首页 > 解决方案 > How to connect sql server for a query in ionic 3?

问题描述

I would like to connect my ionic V3 application to SQL Server database, where should I put the config object and how can I use the database in my application? What I need is to display the result from the query as table or grid in the homepage.

In summary:

  1. Connect the application to the database
  2. Make some query
  3. Display the result of the query in the homepage view

标签: javascriptnode.jssql-serverdatabaseionic-framework

解决方案


you can do this in tow ways :

1- using sqlite :

 SqlServer.init("ipAddress","dbName","dbUser","password",result => {
  console.log(JSON.stringify(result))})}

2- use this tutorial (here) this can be used for fetch data from API's (REST API for example ) of to build your own sql query and use it as API


推荐阅读