Skip to content

Commit 67c734d

Browse files
committed
microsoft data sql testing
1 parent e54ddd0 commit 67c734d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+154
-63
lines changed

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;TrustServerCertificate=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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ With a datareader obtained from a custom command you can still reuse the typed r
103103
let getDatesQuery = "SELECT GETDATE() AS Now, GETUTCDATE() AS UtcNow"
104104
type GetDates = SqlCommandProvider<getDatesQuery, connectionString>
105105

106-
open System.Data.SqlClient
106+
open Microsoft.Data.SqlClient
107107
type SqlDataReader with
108108
member this.ToRecords<'T>() =
109109
seq {

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;TrustServerCertificate=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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(*** hide ***)
2-
#r @"..\..\bin\net40\FSharp.Data.SqlClient.dll"
2+
#r @"..\..\bin\net462\FSharp.Data.SqlClient.dll"
33
#r "System.Transactions"
44
open FSharp.Data
55

@@ -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.9.0" Condition="'$(TargetFramework)' != 'net462'" />
49+
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.2" />
4950
</ItemGroup>
5051

5152
</Project>

nuget/SqlClient.nuspec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,18 @@
2424
<dependencies>
2525
<group targetFramework="net462">
2626
<dependency id="FSharp.Core" version="8.0.301" />
27+
<dependency id="Microsoft.Data.SqlClient" version="6.0.1" />
2728
</group>
2829
<group targetFramework="netstandard2.0">
2930
<dependency id="FSharp.Core" version="8.0.301" />
3031
<dependency id="System.Data.SqlClient" version="4.9.0" />
32+
<dependency id="Microsoft.Data.SqlClient" version="6.0.1" />
3133
<dependency id="System.Configuration.ConfigurationManager" version="9.0.4" />
3234
</group>
3335
<group targetFramework="net8.0">
3436
<dependency id="FSharp.Core" version="8.0.301" />
3537
<dependency id="System.Data.SqlClient" version="4.9.0" />
38+
<dependency id="Microsoft.Data.SqlClient" version="6.0.1" />
3639
<dependency id="System.Configuration.ConfigurationManager" version="9.0.4" />
3740
</group>
3841
</dependencies>

paket.dependencies

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ group DesignTime
4242
framework: >= net462, >= netstandard20, net8.0
4343
storage: none
4444

45+
nuget Microsoft.Data.SqlClient 6.0.1
4546
nuget System.Configuration.ConfigurationManager 9.0.4
4647
nuget System.Data.Common
4748
nuget System.Data.SqlClient
@@ -54,6 +55,7 @@ group Test
5455
source https://www.nuget.org/api/v2/
5556

5657
nuget FSharp.Core redirects:force
58+
nuget Microsoft.Data.SqlClient 6.0.1
5759
nuget System.Data.SqlClient
5860
nuget System.Configuration.ConfigurationManager
5961

@@ -75,6 +77,7 @@ group TestProjects
7577
storage: none
7678

7779
nuget FSharp.Core = 8.0.301
80+
nuget Microsoft.Data.SqlClient 6.0.1
7881

7982
nuget System.Data.SqlClient
8083
nuget System.Configuration.ConfigurationManager
@@ -90,6 +93,8 @@ group Samples
9093
nuget Microsoft.AspNet.WebApi.Client
9194
nuget Microsoft.AspNet.WebApi.Core
9295
nuget Microsoft.AspNet.WebApi.WebHost
96+
nuget System.Data.SqlClient
97+
nuget Microsoft.Data.SqlClient 6.0.1
9398
nuget Microsoft.SqlServer.Types
9499

95100
nuget Newtonsoft.Json redirects: force

0 commit comments

Comments
 (0)