Skip to content

Commit

Permalink
add error param
Browse files Browse the repository at this point in the history
  • Loading branch information
rcanedo committed Oct 8, 2012
1 parent f83ee15 commit 66728e2
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,23 @@ var ConnectionPool = require('tedious-connection-pool');

var pool = new ConnectionPool(poolConfig, connectionConfig);

pool.requestConnection(function (connection) {
var request = new Request('select 42', function(err, rowCount) {
assert.strictEqual(rowCount, 1);
pool.requestConnection(function (error, connection) {
if(!err) {
var request = new Request('select 42', function(err, rowCount) {
assert.strictEqual(rowCount, 1);

// Release the connection back to the pool.
connection.close();
});

request.on('row', function(columns) {
assert.strictEqual(columns[0].value, 42);
});

connection.on('connect', function(err) {
connection.execSql(request);
});
// Release the connection back to the pool.
connection.close();
});

request.on('row', function(columns) {
assert.strictEqual(columns[0].value, 42);
});

connection.on('connect', function(err) {
connection.execSql(request);
});
}
});
```

Expand Down

0 comments on commit 66728e2

Please sign in to comment.