We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am using the latest versions of node, express and mssql module. I am trying to connect to the local instance of sql server 2014 using express.js.
I am using mssql module and callbacks mechanism from the official documentation.
I have tried:
const express= require('express'); const app= express(); const mssql= require('mssql'); app.get('/', (req, res) => { const configuration= { name: "default", host: 'localhost', database: 'HimHer', user: '', password: '', port: 1433 } new mssql.connect(configuration, error => { new mssql.Request().query('Select * from Users', (err, dataset) => { if(err) { console.log(err); res.send(err); return; } else { console.dir(dataset); res.send(JSON.stringify(dataset)); return; } }); }); mssql.close(); mssql.on('error', err => { console.log(err); }); }); app.listen(5000, () => { console.log('Listening to requests on port 5000'); })
I want it to be connected to the database but it throws error:
{"code":"ENOCONN","name":"RequestError"}
The text was updated successfully, but these errors were encountered:
YOU CAN TRY THIS
Sorry, something went wrong.
No branches or pull requests
I am using the latest versions of node, express and mssql module. I am trying to connect to the local instance of sql server 2014 using express.js.
I am using mssql module and callbacks mechanism from the official documentation.
I have tried:
I want it to be connected to the database but it throws error:
{"code":"ENOCONN","name":"RequestError"}
The text was updated successfully, but these errors were encountered: