javascript - 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:
- Connect the application to the database
- Make some query
- 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
推荐阅读
- android - 在 Android 上使用 glEGLImageTargetTexture2DOES 替换 glReadPixels
- javascript - 在 d3 树形图 v4 中添加切换功能
- ios - Swift:UIlabel 文本属性已更改,但 UI 中显示的值没有更改
- python - 如何在不使用正则表达式的情况下删除 -> 之后的字符
- bash - 如何检查字符串是否包含 Makefile 命令中的子字符串
- javascript - React-Redux -> 为什么我的 reducer 没有将更改的状态返回到索引页面?
- c# - 如何让 IDE 在设计时识别 MVVM 中的 View-ViewModel 绑定?
- azure - 在 Azure 发布管道中,是否可以一次手动触发多个发布管道?
- html - Angular 10 - 防止回车在呈现为 HTML 的文本文字的开头和结尾添加空格
- storybook - 需要“fs”的模块在故事书中不起作用,但在浏览器中起作用