63b0e69ddbbc1b12fec456e0296fb5384d15e141
FAQ/Questions/ConnectionStringRW.md
| ... | ... | @@ -47,6 +47,16 @@ Public Class CustomAdHocConfig |
| 47 | 47 | End Class |
| 48 | 48 | ``` |
| 49 | 49 | |
| 50 | +Though ConnectionStringRW doesn't require Fusion, if you want to use Fusion together with ConnectionStringRW, read-only connection strings should be used everywhere in Fusion/DB initialization, and assign read/write connection string here: |
|
| 51 | + |
|
| 52 | +```csharp |
|
| 53 | +FusionDriver fd = new FusionDriver(); |
|
| 54 | + fd.AddConnection("_alias_", FusionConnectionType.MsSql, "_read_only_connection_string_"); |
|
| 55 | + AdHocContext.Driver = fd; |
|
| 56 | + AdHocSettings.AdHocConfig = new CustomAdHocConfig(); |
|
| 57 | + ((DatabaseAdHocConfig) AdHocSettings.AdHocConfig).SavedReportsDriver = new MSSQLDriver("_read_only_connection_string_"); |
|
| 58 | + ((DatabaseAdHocConfig) AdHocSettings.AdHocConfig).SavedReportsDriver.ConnectionStringRW = "_read/write_connection_string_"; |
|
| 59 | +``` |
|
| 50 | 60 | |
| 51 | 61 | ##How ConnectionStringRW works |
| 52 | 62 | |
| ... | ... | @@ -73,3 +83,7 @@ End Class |
| 73 | 83 | |
| 74 | 84 | ##Usage |
| 75 | 85 | ConnectionStringRW can be used always. General case is just safety improvement - if user specifies ConnectionStringRW, and uses read-only DB account for usual Driver.ConnectionString - he can be 100% sure that users will not be able to modify anything in DB by any means - like using SQL injections. Just because everything which user can input - goes to DB via read-only connection string. |
| 86 | + |
|
| 87 | +## |
|
| 88 | + |
|
| 89 | + |