FAQ/Questions/ConnectionStringRW.md
... ...
@@ -1,10 +1,9 @@
1
-##Question
1
+##About
2 2
3
-How do I add Read-Write user permission to DB?
3
+ConnectionStringRW is one of Izenda Driver's properties, which enables users to have Read-Write access permission to Database
4 4
5
-##Answer
6 5
7
-Using 'ConnectionStringRW' property, user permissions to DB can be specified. This property should be assigned similarly to normal connection string as below - in the initialization of reporting.
6
+Below is a sample global.asax using the ConnectionStringRW setting. The code block will appear within <script runat="server"> </script> tags within global.asax
8 7
9 8
```csharp
10 9
... ...
@@ -21,6 +20,58 @@ Using 'ConnectionStringRW' property, user permissions to DB can be specified. Th
21 20
}
22 21
}
23 22
```
23
+
24
+
25
+
26
+##Question
27
+
28
+How do I add Read-Write user permission to DB?
29
+
30
+##Answer
31
+
32
+Using 'ConnectionStringRW' property, user permissions to DB can be specified. This property should be assigned similarly to normal connection string as below - in the initialization of reporting.
33
+
34
+##Global.asax (C♯)
35
+```csharp
36
+
37
+ public class CustomAdHocConfig : FileSystemAdHocConfig {
38
+ public static void InitializeReporting() {
39
+ //Check to see if we've already initialized.
40
+ if (HttpContext.Current.Session == null || HttpContext.Current.Session["ReportingInitialized"] != null)
41
+ return;
42
+ //Initialize System
43
+ AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE";
44
+ AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE";
45
+ AdHocContext.Driver.ConnectionStringRW = "INSERT_CONNECTION_STRING_HERE"; // ConnectionStringRW was used
46
+ ...
47
+ }
48
+}
49
+```
50
+##Global.asax (VB.NET)
51
+
52
+```visualbasic
53
+
54
+'main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig
55
+Public Class CustomAdHocConfig
56
+ Inherits Izenda.AdHoc.DatabaseAdHocConfig
57
+
58
+ Shared Sub InitializeReporting()
59
+ 'Check to see if we've already initialized
60
+ If HttpContext.Current.Session Is Nothing OrElse HttpContext.Current.Session("ReportingInitialized") IsNot Nothing Then
61
+ Return
62
+ 'Initialize System
63
+ AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"
64
+ AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE"
65
+ AdHocContext.Driver.ConnectionStringRW = "INSERT_CONNECTION_STRING_HERE
66
+
67
+
68
+ End Sub
69
+
70
+End Class
71
+```
72
+
73
+
74
+
24 75
If it's not assigned, Izenda as before uses Driver.ConnectionString for all operations against DB
25 76
26 77