Object Must Implement IConvertible with MS Data Access Application Block

Ran into this bug today. I’m not the first, as a quick google search found:

Google group thread.

Ted Graham also wrote about it, specifically for Access.

I think I’m close to finding the actual bug in the C# version of the DAAB, but I don’t have time to totally fix it just yet. However, I did find a workaround that I hope will help some folks. I was calling a stored procedure like so:

return SqlHelper.ExecuteDataset(ConnectionString, "usp_ListAuthors", sqlArgs).Tables [0];

All I did to fix it was switch to another overload:

return SqlHelper.ExecuteDataset(ConnectionString, CommandType.StoredProcedure,"usp_ListAuthors", sqlArgs).Tables [0];

Simply specifying the CommandType fixed it. I’m sure the other version has a bug in it – if you have the exact fix, I’d love to hear it.

Thanks!

If you liked this post, consider subscribing to email updates about my new posts, or sharing it on Hacker News.

Keyboard shortcuts

?
Show this help
Esc
Close this help or an open menu
n
Next (newer) post: NUnit 2.1 Final Release Available
p
Previous (older) post: Databinding Server Controls – Learned Something New
Tab
Move between links and buttons (Shift+Tab to go back)