This is a weird one.
So I'm cruising along developing a MVC5 web site, and everything is going pretty well, including using stored procs from the database.
Then I added a new call to the database. This call fails with the exception Keyword not supported 'initial catalog'
when I try to create a SqlConnection
object with the connection string.
If I comment out the call to hit the stored proc, ALL OTHER DATABASE TRANSACTIONS (using the same connection string) PROCEED NORMALLY. This led me to think there was something wrong with the stored proc, but sql server manager reports no errors, and I'm using the correct name and SqlParameter
list.
I'm at a loss (and yes, I include the providerName
property in the connection string key in web.config).
More Info:
0) I inspected the connection string at the point of failure, and it is an accurate representation of the way it's specified in the web.conf file.
1) The next database call in the app startup (both calls are in the same controller method) succeeds.
2) The stored proc in question is expecting a string that can be no longer than 36 characters, and the string I'm passing is only 32 characters.
3) It fails when I try to create the SqlConnection object, so the stored proc itself is not a factor in the failure.
4) If I move this call to follow another database call (that succeeds), this call still fails when I try to create the SqlConnection
object.
What I have tried:
This info would essentially be a duplicate of my question. What a waste of bandwidth.