Skip to content

Commit fcc03f6

Browse files
update help
1 parent c0de3af commit fcc03f6

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

docs/content/debugging.fsx

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,26 +52,24 @@ While enjoying all benefits of static types at design time one can easily end up
5252
when runtime Sql Server database schema is different from compile time.
5353
Up until now this resulted in confusion runtime exception: `InvalidCastException("Specified cast is not valid.")`.
5454
55-
To improve diagnostics without hurting performance a new configuration section/switch is introduced.
56-
57-
First, define custom sectoin in app.config/web.config
58-
59-
[lang=xml]
60-
<configSections>
61-
<section name="FSharp.Data.SqlClient" type="System.Configuration.NameValueSectionHandler" />
62-
</configSections>
55+
To improve diagnostics without hurting performance a new global singleton configuration object is introduced.
56+
To access Configuration type open up FSharp.Data.SqlClient namespace.
57+
*)
6358

64-
Second, set on `ResultsetRuntimeVerification` switch
59+
open FSharp.Data.SqlClient
60+
assert(Configuration.Current.ResultsetRuntimeVerification = false)
6561

66-
[lang=xml]
67-
<FSharp.Data.SqlClient>
68-
<add key="ResultsetRuntimeVerification" value="true"/>
69-
</FSharp.Data.SqlClient>
62+
(**
63+
So far it has only one property ResultsetRuntimeVerification which set to false by default.
64+
Set it to true to see more descriptive error like:
7065
71-
Now expect to see more descriptive error like:
7266
`InvalidOperationException(Expected column [Total] of type "System.Int32" at position 1 (0-based indexing)
7367
but received column [Now] of type "System.DateTime")`.
68+
*)
69+
70+
Configuration.Current <- { Configuration.Current with ResultsetRuntimeVerification = true }
7471

72+
(**
7573
Other debugging/instrumentation tools to consider:
7674
-------------------------------------
7775

0 commit comments

Comments
 (0)