简体   繁体   中英

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM