Skip to content

Commit 9d851b9

Browse files
Swap referenced to Microsoft.Data.SqlClient for SqlClient solution
1 parent c8148eb commit 9d851b9

27 files changed

+1528
-333
lines changed

build.fsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Target.create "Build" (fun _ ->
105105
#r "System.IO.Compression"
106106
#r "System.IO.Compression.FileSystem"
107107

108-
open System.Data.SqlClient
108+
open Microsoft.Data.SqlClient
109109
open System.Configuration
110110
open System.IO.Compression
111111

docs/content/configuration and Input.fsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ module DB =
227227
[<Literal>]
228228
let connStr = @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True"
229229

230-
open System.Data.SqlClient
230+
open Microsoft.Data.SqlClient
231231

232232
type MyCmd1 = SqlCommandProvider<"SELECT 42", connStr>
233233
type MyCmd2 = SqlCommandProvider<"SELECT 42", connStr>
@@ -291,7 +291,7 @@ type GetBitCoin =
291291

292292
do
293293
let cmd = new DeleteBitCoin(connStr) in cmd.Execute(bitCoinCode) |> ignore
294-
let conn = new System.Data.SqlClient.SqlConnection(connStr)
294+
let conn = new Microsoft.Data.SqlClient.SqlConnection(connStr)
295295
conn.Open()
296296
let tran = conn.BeginTransaction()
297297

docs/content/data modification.fsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ do
276276

277277
currencyRates.Rows.Add newRow
278278
//Insert many more rows here
279-
currencyRates.BulkCopy(copyOptions = System.Data.SqlClient.SqlBulkCopyOptions.TableLock)
279+
currencyRates.BulkCopy(copyOptions = Microsoft.Data.SqlClient.SqlBulkCopyOptions.TableLock)
280280

281281
(**
282282
@@ -285,13 +285,13 @@ Custom update/bulk copy logic
285285
Both `Update` and `BulkCopy` operations can be configured via parameters, i.e. connection, transaction, batchSize, etc.
286286
That said, default update logic provided by typed DataTable can be insufficient for some advanced scenarios.
287287
You don't need to give up on convenience of static typing, however. You can also
288-
customize update behavior by creating your own instance of [SqlDataAdapter](https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldataadapter.aspx)
289-
(or [SqlBulkCopy](https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.aspx)) and configuring it to your needs.
288+
customize update behavior by creating your own instance of [SqlDataAdapter](https://msdn.microsoft.com/en-us/library/Microsoft.Data.SqlClient.sqldataadapter.aspx)
289+
(or [SqlBulkCopy](https://msdn.microsoft.com/en-us/library/Microsoft.Data.SqlClient.sqlbulkcopy.aspx)) and configuring it to your needs.
290290
291291
Pseudocode for custom data adapter:
292292
*)
293293

294-
open System.Data.SqlClient
294+
open Microsoft.Data.SqlClient
295295

296296
do
297297
let currencyRates = new AdventureWorks.Sales.Tables.CurrencyRate()

docs/content/faq.fsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ With a datareader obtained from a custom command you can still reuse the typed r
106106
let getDatesQuery = "SELECT GETDATE() AS Now, GETUTCDATE() AS UtcNow"
107107
type GetDates = SqlCommandProvider<getDatesQuery, connectionString>
108108

109-
open System.Data.SqlClient
109+
open Microsoft.Data.SqlClient
110110
type SqlDataReader with
111111
member this.ToRecords<'T>() =
112112
seq {
@@ -123,7 +123,7 @@ type SqlDataReader with
123123
let xs =
124124
use conn = new SqlConnection(connectionString)
125125
conn.Open()
126-
let cmd = new System.Data.SqlClient.SqlCommand(getDatesQuery, conn)
126+
let cmd = new Microsoft.Data.SqlClient.SqlCommand(getDatesQuery, conn)
127127
cmd.ExecuteReader().ToRecords<GetDates.Record>()
128128
|> Seq.toArray
129129

docs/content/output.fsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ In later case, resulting `SqlDataReader` can be wrapped into something like that
248248
*)
249249

250250
module SqlDataReader =
251-
open System.Data.SqlClient
251+
open Microsoft.Data.SqlClient
252252
let toMaps (reader: SqlDataReader) =
253253
seq {
254254
use __ = reader

docs/content/sqlenumprovider.quickstart.fsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ A typical implementation for overnight orders shipped since Jan 1, 2008 is follo
4040
let connStr = @"Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=True"
4141

4242
open System
43-
open System.Data.SqlClient
43+
open Microsoft.Data.SqlClient
4444

4545
let conn = new SqlConnection (connStr)
4646
conn.Open()
@@ -220,7 +220,7 @@ Miscellaneous
220220
221221
### Any ADO.NET supported database
222222
SqlEnumProvider has a static parameter "Provider" which allows to pass ADO.NET provider [invariant name](http://msdn.microsoft.com/en-us/library/h508h681.aspx).
223-
This makes it usable with any ADO.NET supported database. "System.Data.SqlClient" is default value for ADO.NET provider.
223+
This makes it usable with any ADO.NET supported database. "Microsoft.Data.SqlClient" is default value for ADO.NET provider.
224224
225225
Invariant names of available ADO.NET providers can be retrieved as follows:
226226
*)

docs/content/transactions.fsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ This conforms to familiar [ADO.NET conventions](https://msdn.microsoft.com/en-us
3232
*)
3333

3434
open System
35-
open System.Data.SqlClient
35+
open Microsoft.Data.SqlClient
3636

3737
type CurrencyCode =
3838
SqlEnumProvider<"SELECT Name, CurrencyCode FROM Sales.Currency", connectionString>
@@ -224,8 +224,8 @@ provided the connections are not open at the same time (which would result in mu
224224
225225
<div class="well well-small" style="margin:0px 70px 0px 20px;">
226226
227-
**TIP** The value of the [Enlist](https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnectionstringbuilder.enlist.aspx)
228-
key from [SqlConnection.ConnectionString](https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring.aspx)
227+
**TIP** The value of the [Enlist](https://msdn.microsoft.com/en-us/library/Microsoft.Data.SqlClient.sqlconnectionstringbuilder.enlist.aspx)
228+
key from [SqlConnection.ConnectionString](https://msdn.microsoft.com/en-us/library/Microsoft.Data.SqlClient.sqlconnection.connectionstring.aspx)
229229
property determines the auto-enlistment behavior of connection instance.
230230
</p></div>
231231

docs/content/whatsnew.fsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Any of these parameters can be ommited.
4343
#r "System.Transactions"
4444

4545
do
46-
use conn = new System.Data.SqlClient.SqlConnection( connectionString)
46+
use conn = new Microsoft.Data.SqlClient.SqlConnection( connectionString)
4747
conn.Open()
4848
use tran = conn.BeginTransaction()
4949
use cmd =

netfx.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646

4747
<ItemGroup>
4848
<PackageReference Include="System.Data.SqlClient" Version="4.5.1" Condition="'$(TargetFramework)' != 'net40'" />
49+
<PackageReference Include="Microsoft.Data.SqlClient" Version="1.1.1" Condition="'$(TargetFramework)' != 'net40'" />
4950
</ItemGroup>
5051

5152
</Project>

nuget/SqlClient.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</group>
2828
<group targetFramework="netstandard2.0">
2929
<dependency id="FSharp.Core" version="4.3.4" />
30-
<dependency id="System.Data.SqlClient" version="4.5.1" />
30+
<dependency id="Microsoft.Data.SqlClient" version="4.5.1" />
3131
<dependency id="System.Configuration.ConfigurationManager" version="4.5.0" />
3232
</group>
3333
</dependencies>

0 commit comments

Comments
 (0)