Hello, all The documentation is not very clear on whether or not it is possible to set initString parameter directly in the connection string when working with ADO.NET Something like: "server=srv;dbn=database;con=connectionName;initStr={my authentication string}" I know it is possible to use the initString property, but if there is a problem to change a code, we might want to just change the config file. Thank you |
Here is an example: SAConnection conn = new SAConnection("uid=dba;pwd=sql;eng=A_DB_ENG; InitString=\"SET TEMPORARY OPTION CONNECTION_AUTHENTICATION='{hidden}'\""); |
AFAIK, you can use the InitString connection parameter for non-ODBC connections as well. There are several questions here dealing with that parameter for different APIs.
I went over these questions, but they all deal with changes in code, i.e., setting property InitString of SAConnection or using ExecuteCommand function. I did not find anything conclusive regarding connection string for ADO.NET. If anyone has a working example it would be greatly appreciated.
The following doc page shows a sample for an OLE DB connection using an InitString to provide the authentication information.
AFAIK, you can use such a connection string for any API, and I'm quite sure you can use that as part of a DSN or DSN-less. But note, I have not used this with ADO.Net myself.