{"action":"created","issue":{"url":"https://api.github.com/repos/patriksimek/node-mssql/issues/138","labels_url":"https://api.github.com/repos/patriksimek/node-mssql/issues/138/labels{/name}","comments_url":"https://api.github.com/repos/patriksimek/node-mssql/issues/138/comments","events_url":"https://api.github.com/repos/patriksimek/node-mssql/issues/138/events","html_url":"https://github.com/patriksimek/node-mssql/issues/138","id":60254336,"number":138,"title":"Connection Error: Connection is Closed","user":{"login":"hasan3ysf","id":840673,"avatar_url":"https://avatars.githubusercontent.com/u/840673?v=3","gravatar_id":"","url":"https://api.github.com/users/hasan3ysf","html_url":"https://github.com/hasan3ysf","followers_url":"https://api.github.com/users/hasan3ysf/followers","following_url":"https://api.github.com/users/hasan3ysf/following{/other_user}","gists_url":"https://api.github.com/users/hasan3ysf/gists{/gist_id}","starred_url":"https://api.github.com/users/hasan3ysf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hasan3ysf/subscriptions","organizations_url":"https://api.github.com/users/hasan3ysf/orgs","repos_url":"https://api.github.com/users/hasan3ysf/repos","events_url":"https://api.github.com/users/hasan3ysf/events{/privacy}","received_events_url":"https://api.github.com/users/hasan3ysf/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/patriksimek/node-mssql/labels/discussion","name":"discussion","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2015-03-08T12:23:55Z","updated_at":"2015-12-23T00:13:23Z","closed_at":null,"body":"Hi..\r\n\r\nI'm able to access my MSSQL from MSQL Studio.\r\ndefined my index.js file as below, but it keeps give me this error:\r\n\r\n{ [ConnectionError: Connection is closed.]\r\n  name: 'ConnectionError',\r\n  message: 'Connection is closed.',\r\n  code: 'ECONNCLOSED'}\r\n\r\nwhat wrong I'm doing, if below is my code, thanks\r\n\r\n     var sql = require('mssql'); \r\n     var config = { user: 'sa', password: 'bk123', server: 'HASN-BK\\\\SQLEXPRESS', database: 'BK',\r\n    stream: true }\r\n\r\n      sql.connect(config, function(err) {\r\n     var request = new sql.Request();\r\n     request.stream = true; \r\n    request.query('SELECT * from emp');\r\n\r\n    request.on('recordset', function(columns) {\r\n        console.log(columns);\r\n        // Emitted once for each recordset in a query\r\n    });\r\n\r\n    request.on('row', function(row) {\r\n        console.log(row);\r\n        // Emitted for each row in a recordset\r\n    });\r\n\r\n    request.on('error', function(err) {\r\n        console.log(err);\r\n        // May be emitted multiple times\r\n    });\r\n\r\n    request.on('done', function(returnValue) {\r\n        // Always emitted as the last one\r\n    });\r\n});\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/patriksimek/node-mssql/issues/comments/166766533","html_url":"https://github.com/patriksimek/node-mssql/issues/138#issuecomment-166766533","issue_url":"https://api.github.com/repos/patriksimek/node-mssql/issues/138","id":166766533,"user":{"login":"christopheranderson","id":2252976,"avatar_url":"https://avatars.githubusercontent.com/u/2252976?v=3","gravatar_id":"","url":"https://api.github.com/users/christopheranderson","html_url":"https://github.com/christopheranderson","followers_url":"https://api.github.com/users/christopheranderson/followers","following_url":"https://api.github.com/users/christopheranderson/following{/other_user}","gists_url":"https://api.github.com/users/christopheranderson/gists{/gist_id}","starred_url":"https://api.github.com/users/christopheranderson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christopheranderson/subscriptions","organizations_url":"https://api.github.com/users/christopheranderson/orgs","repos_url":"https://api.github.com/users/christopheranderson/repos","events_url":"https://api.github.com/users/christopheranderson/events{/privacy}","received_events_url":"https://api.github.com/users/christopheranderson/received_events","type":"User","site_admin":false},"created_at":"2015-12-23T00:13:23Z","updated_at":"2015-12-23T00:13:23Z","body":"Interestingly, I'm getting this bug, but only when both of these are true:\r\n - Using an ADO.NET connection string\r\n - Using an Azure Web App\r\n\r\nLocally it works with a connection string and Azure Web App works when using an explicit config object. I can't seem to tell how to set the debug flag to true with a connection string, so I don't have a log. Is it possible to debug with a connection string?"}}