I've always understood that @@identity was problematic because you could get the identity value of records inserted into a different table by a trigger. Also, to reduce latency, this reduces the round-trips from two to one.
Changed CreateInsertCommand to use SCOPE_IDENTITY() to reduce roundtr…
…ips and prevent possible problems caused by triggers
Fixed connection leak in QueryAsync and added it back
Sorry, didn't know each commit would append to the pull request. If it's a pain I can create a branch for merging or let me know what you'd prefer - I'm such a noob.
Problem is that it doesn't work with SQL CE