c# - Keyword not supported exception when attempting to use a connection string that points to a ODBC DSN -
i created odbc dsn asp.net mvc application's database access. 1 of main reasons makes easy keep database credentials (such server address, port, username, , password) out of source control without hindering publishing abilities.
so changed connection dsn=mydsn.
unfortunately, when run entity framework queries exception details: system.argumentexception: keyword not supported: 'dsn'.
does know doing wrong?
if want use odbc dsn connection string must use system.data.odbc native provider instead of managed sql client.
edit:
so theory practice. doesn't work because of internal ef implementation. ef internally calls method tries dbproviderfactory created connection. problem property defined in dbconnection , returns null. sqlconnection overrides property , returns correct factory. ef doesn't work default odbc provider , here described why.
Comments
Post a Comment