I’ve got this piece of code:
try
{
using(conn)
{
conn.UpdateScheduledTaskGuid(taskID, taskGUID);
}
}
On the conn variable I’m getting the error “Cannot implicitly convert type DataProvider to System.IDisposable“
DataProvider is a custom class that someone created in this project I’m working in which is the type for the conn variable above.
I guess I need to have DataProvider implement IDisposable but I am not sure if that’s really the problem here or not and if I do have to implement it, what unmanaged resources is it having a problem with that requires me to add IDisposable?
Here’s the DataProvider class:DataProvider.txt
DataProvidermust indeed implementIDisposable, because it owns aIDbConnection, which it must properly dispose of.