Reputation: 519
I have a basic reactjs application which has a form that I want on submit, should store the value of input elements(text-boxes, selects and radio buttons), to store the data to the database in azure SQL DB. The react app (front-end only yet) is deployed using the Azure App service.
I have been looking for ways on how to approach this, but the more i explored the more i got confused. The official documentation suggests using tedious, and some sources recommend using express with sequelize, and a few more.
I'm looking for a direction on how to approach this. I, being a beginner in this, am open to suggestions or if someone can direct me to a source that might be of some help.
Upvotes: 2
Views: 3733
Reputation: 24138
It sounds like you want to directly connect Azure SQL Database from the front-end of your ReactJS App in a browser. There is a similar SO thread How to connect to SQL Server database from JavaScript in the browser? had been answered for this scenario. But it's impossible for working in modern browsers, because the solution using ActiveXObject
only works in the old IE browser.
So a backend server using express for NodeJS or other framework in other language is necessary to get the data submitted from the frontend page of ReactJS page and store to Azure SQL Database using tedious for NodeJS or other ORM framework for other language.
For Node.js, please refer to the offical tutorial Node.js Driver for SQL Server
to know how to operate SQL Server at the Node backend.
Upvotes: 2