As the title suggesting, I've been doing some research on the cause of this error. Then I saw this which primarily suggesting that it is most likely related to license number. However, at the very bottom there was a reply suggesting that calling dispose() for connection object would also be a solution. Is this true?
Note: we are using Entity Framework 4.0 and SQLAnywhere 16
Update: I've found this article which seems to be suggesting that calling dispose does not have any impact on user connection. Any thoughts? Thanks much!
Kevin brought up a good point in the comments. It's easiest to just put your connection in a using statement so it is automatically disposed of when not in use.
// connectionString must be set up
using (SqlConnection connection = new SqlConnection(connectionString))
{
// Do stuff with connection to DB
}
You were wondering if Dispose needed to ever be called and if it would have an impact on user connection. Actually, the using statement calls Dispose() itself, as you can see here. "The using statement calls the Dispose method on the object in the correct way..." So, I believe your issue may be because your original way of opening/closing the connections left hanging connections. Instead, using the using
statement, your connections will automatically be closed once the code leaves the block.