11(* ** hide ***)
2- #r @" ..\..\bin\net40 \FSharp.Data.SqlClient.dll"
2+ #r @" ..\..\bin\net462 \FSharp.Data.SqlClient.dll"
33#r " Microsoft.SqlServer.Types.dll"
44(**
55
@@ -46,7 +46,7 @@ CommandText
4646open FSharp.Data
4747
4848[<Literal>]
49- let connStr = @" Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True"
49+ let connStr = @" Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True;TrustServerCertificate=true "
5050
5151//Inline T-SQL text convinient for short queries
5252type GetDate = SqlCommandProvider< " SELECT GETDATE() AS Now" , connStr>
@@ -166,7 +166,7 @@ Connection string can be provided either via literal (all examples above) or inl
166166
167167//Inline
168168type Get42 =
169- SqlCommandProvider< " SELECT 42" , @" Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True" >
169+ SqlCommandProvider< " SELECT 42" , @" Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True;TrustServerCertificate=true " >
170170
171171(**
172172
@@ -225,7 +225,7 @@ let get42 = new Get42(runTimeConnStr)
225225//Factory or IOC of choice to avoid logic duplication. Use F# ctor static constraints.
226226module DB =
227227 [<Literal>]
228- let connStr = @" Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True"
228+ let connStr = @" Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True;TrustServerCertificate=true "
229229
230230 open System.Data .SqlClient
231231
@@ -247,9 +247,9 @@ let dbCmd2: DB.MyCmd2 = DB.createCommand()
247247//Static type property ConnectionStringOrName that has exactly same value as passed into SqlCommandProvider helps.
248248module DataAccess =
249249 [<Literal>]
250- let adventureWorks = @" Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True"
250+ let adventureWorks = @" Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True;TrustServerCertificate=true "
251251 [<Literal>]
252- let master = @" Data Source=.;Initial Catalog=master;Integrated Security=True"
252+ let master = @" Data Source=.;Initial Catalog=master;Integrated Security=True;TrustServerCertificate=true "
253253
254254 type MyCmd1 = SqlCommandProvider< " SELECT 42" , adventureWorks>
255255 type MyCmd2 = SqlCommandProvider< " SELECT 42" , master>
0 commit comments