So, I'm working on some R&D code for the new Subtext 2.0 (coming soon to a harddrive near you!). Had to run a stored procedure to get some information back from the database. Simple, right?
Spent 2 hours trying to figure out why I was getting this error
System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near 'sp_myStoredProcedure'
No matter what I did it pooped out on me. Spent a good bit of time researching the proper way to do a stored procedure thinking, well, it is .Net 2.0, maybe something's changed.
Turns out, nothing's changed. You still have to set cmd.CommandType = CommandType.StoredProcedure; If you forget to do that, you could spend 2 hours researching a stupid mistake.
I'd blame the beer, but I had none tonight.