How do i detect the provider from a user-specified connectionstring?
问题 My application needs to do a certain query against a user-specified connectionstring. The query will need some parameters, so I was thinking of using the DbProviderFactory , in combination with myConnection.GetSchema("DataSourceInformation").Rows[0]["ParameterMarkerFormat"] to find out if I need to use : (Oracle), @ (Sql) or ? (OleDb) to send in the parameters to the database. To use the DbProviderFactory I need to find out what Provider is needed for a connectionstring. Is there a good way