Skip to content

docs: clarify required legacy SqlClient examples - #56464

Draft
dlevy-msft-sql wants to merge 4 commits into
dotnet:mainfrom
dlevy-msft-sql:dlevy-msft-sql-retained-sqlclient-warnings
Draft

dlevy-msft-sql wants to merge 4 commits into
dotnet:mainfrom
dlevy-msft-sql:dlevy-msft-sql-retained-sqlclient-warnings

Conversation

@dlevy-msft-sql

@dlevy-msft-sql dlevy-msft-sql commented Oct 20, 2026 •

Copy link
Copy Markdown

Summary

Coverage limits

The retained examples require Windows-only .NET Framework CAS, LINQ to SQL, or built-in System.Data.Entity. Linux and macOS hosts are available, but they aren't supported runtimes for these unchanged integrations. The VB UInt32 example fails during translation before its SQL query runs. The original net40 assembly's database method passed separately; its interactive Main did not complete unattended. Historical SQL Server 2000/2005 behavior wasn't reproduced on SQL Server 2025.

Problem

Retained System.Data.SqlClient examples and integration guidance need an explicit prohibition on new development. This follow-up applies only where the existing .NET Framework integration requires that provider. It does not add warnings to examples migrated to Microsoft.Data.SqlClient.

Integration constraints

  • Code access security examples demonstrate the built-in .NET Framework SQL provider's permissions. Code access security isn't supported in modern .NET.
  • .NET Framework's built-in LINQ to SQL provider requires System.Data.SqlClient. Changing the connection type alone doesn't migrate LINQ to SQL.
  • The Entity Framework examples use the built-in System.Data.Entity SQL provider and models whose EDMX files select System.Data.SqlClient. That integration requires migration beyond a namespace substitution. The same constraint applies to the retained provider, permission, and EdmGen guidance.

Solution

Add IMPORTANT boxes to 12 existing pages and prohibition/reason comments inside 31 displayed C#/VB code regions, covering 33 snippet-consumer occurrences. The inline CAS XML permission-set example receives a separate comment and is not included in those counts. Six pages receive page-only notices for existing integration guidance without displayed SDS code; no code is invented to satisfy the comment requirement. Two LINQ articles are shared-snippet consumers.

Preserve 27 executable regions unchanged and repair four LINQ regions after live validation exposed defects: missing mapped primary keys in the C#/VB parameter examples, malformed VB parameter arguments, missing whitespace in the VB joined query, and a VB DataContext created on a different connection from its transaction. Keep SDS integration, sample models, snippet identifiers, references, and C#/VB coverage. No samples are removed. After the initial snippets CI failed with MSB3644, add a project-local reference-assembly dependency and resolved Visual Basic runtime selection to the original VB Entity Framework project. Keep its .NET Framework 4.0 target unchanged. The final scope is 23 paths: 12 articles, ten source files, and one project.

Generated material includes the notices, comments, metadata, project-only build correction, and the targeted live-validation repairs. The two affected articles explain the mapped primary-key requirement and the measured C#/VB unsigned-query difference. The C# Entity Framework executable expression is unchanged; only its false expected-exception comment is corrected. These changes require normal maintainer review.

Changes

Review order: read the three executable LINQ source changes (DLinqAdoNet in C#/VB and DLinqCommunicatingWithDatabase in VB) and their ado-net-and-linq-to-sql.md explanation first. Then read the EF known-issues paragraph and its comment-only C# correction, the CAS/provider-boundary notices, and the net40 project fix. Review the remaining comment-only files for wording and placement. Small follow-on changes still need review.

File Review focus Change
docs/framework/data/adonet/code-access-security.md Major edits Explains why CAS samples retain the built-in .NET Framework provider and why CAS does not apply to modern .NET; adds the matching XML comment and metadata.
docs/framework/data/adonet/ef/language-reference/known-issues-and-considerations-in-linq-to-entities.md Major edits Explains the built-in provider boundary and corrects the unsigned-query paragraph to distinguish measured C# success from VB NotSupportedException before SQL; updates metadata.
docs/framework/data/adonet/sql/linq/how-to-connect-to-a-database.md Major edits Explains the DataContext provider requirement and connection-type migration boundary; updates metadata.
docs/framework/data/adonet/sql/linq/how-to-display-linq-to-sql-commands.md Major edits Explains why the command example retains the built-in LINQ to SQL provider; updates metadata.
docs/framework/data/adonet/sql/linq/how-to-reuse-a-connection-between-an-ado-net-command-and-a-datacontext.md Major edits Explains the built-in provider requirement for the shared connection example and why replacing its connection type is insufficient; updates metadata.
docs/framework/data/adonet/sql/linq/ado-net-and-linq-to-sql.md Major edits Explains the built-in provider boundary and the mapped CustomerID requirement for direct query materialization; updates metadata.
docs/framework/data/adonet/ef/edm-generator-edmgen-exe.md Major edits Explains EdmGen.exe ownership, its default provider, and the integration migration constraint; updates metadata.
docs/framework/data/adonet/ef/entityclient-provider-for-the-entity-framework.md Major edits Explains the built-in SQL provider dependency while preserving the distinction between SQL-specific integration and provider-independent EntityClient APIs; updates metadata.
docs/framework/data/adonet/ef/security-considerations.md Major edits Explains the built-in Entity Framework permission types and provider migration boundary; updates metadata.
docs/framework/data/adonet/ef/sqlclient-for-the-entity-framework.md Major edits Explains why replacing the Provider attribute does not migrate the built-in Entity Framework integration; updates metadata.
docs/framework/data/adonet/sql/linq/security-in-linq-to-sql.md Major edits Explains why the connection security guidance retains the built-in LINQ to SQL provider; updates metadata.
docs/framework/data/adonet/sql/linq/troubleshooting.md Major edits Explains which built-in provider supplies the documented behavior and why replacing its connection type does not migrate it; updates metadata.
samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlClient.CAS/CS/source.cs Small follow-on changes C# CAS prohibition and dependency comments. Only warning/reason comments change; executable code and snippet identifiers remain unchanged.
samples/snippets/csharp/VS_Snippets_Data/DLinqCommunicatingWithDatabase/cs/Program.cs Small follow-on changes Comments in displayed C# connection regions. Only warning/reason comments change; executable code and snippet identifiers remain unchanged.
samples/snippets/csharp/VS_Snippets_Data/DLinqDebuggingSupport/cs/Program.cs Small follow-on changes Comments in displayed C# command region. Only warning/reason comments change; executable code and snippet identifiers remain unchanged.
samples/snippets/csharp/VS_Snippets_Data/DLinqAdoNet/cs/Program.cs Major edits Adds the mapped CustomerID primary key to the parameter query so Customer materialization succeeds; retains the provider notices and existing integration.
samples/snippets/csharp/VS_Snippets_Data/DP L2E Conceptual Examples/CS/Program.cs Small follow-on changes Adds provider notices and corrects the false UInt32 expected-exception comment after expression-tree/live checks; all executable expressions and snippet identifiers remain unchanged.
samples/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks SqlClient.CAS/VB/source.vb Small follow-on changes VB CAS prohibition and dependency comments. Only warning/reason comments change; executable code and snippet identifiers remain unchanged.
samples/snippets/visualbasic/VS_Snippets_Data/DLinqCommunicatingWithDatabase/vb/Module1.vb Major edits Constructs DataContext with the existing SqlConnection so its assigned transaction belongs to that connection; retains the provider notices.
samples/snippets/visualbasic/VS_Snippets_Data/DLinqDebuggingSupport/vb/Module1.vb Small follow-on changes Comments in displayed VB command region. Only warning/reason comments change; executable code and snippet identifiers remain unchanged.
samples/snippets/visualbasic/VS_Snippets_Data/DLinqAdoNet/vb/Module1.vb Major edits Repairs SQL clause whitespace, passes London as a separate parameter, and includes the mapped CustomerID key; retains the provider notices.
samples/snippets/visualbasic/VS_Snippets_Data/DP L2E Conceptual Examples/VB/Module1.vb Small follow-on changes Comments in displayed VB Entity Framework regions. Only warning/reason comments change; executable code and snippet identifiers remain unchanged.
samples/snippets/visualbasic/VS_Snippets_Data/DP L2E Conceptual Examples/VB/l2e_conceptualexamplesvb.vbproj Major edits Changes net40 build compatibility: imports Common.props, restores private reference assemblies, and selects the resolved Visual Basic runtime before compilation; target framework and samples stay unchanged.

Validation

At the original publication stage, this publishing session independently ran:

  • git apply --check <retained-sds-warnings.patch> before the initial commit: passed. Initial 16-file patch SHA256: 944da698d84fcc63e3245d35797d11aada0f1a3c45e105a427261e2a30597e28.
  • git apply --check <retained-sds-page-notices-delta.patch> before the additional six-page commit: passed. Delta SHA256: 3030e5bcdc8062e7528405a9b582dad31513f4831018ad039e1f7b2647b7ceb3.
  • git apply --check <retained-sds-ci-reference-pack.patch> before the project-only correction: passed. Delta SHA256: 0d49da3ae436eeff90c0fe452d9a1d14781762db8b3f4b3b9a26404bc72f37b4.
  • Python comparison of git diff 7a5a9cf8549d2356a135e1686949f4f205cc4843 --name-only and UTF-8/LF-normalized SHA256 hashes against the final coordinating-session export: exactly 23 paths, all 23 hashes match. The preceding 22-file documentation/source export had SHA256 7dd65c2b1bd4bf8d7f9b17ff3627e57d89815344f38af819eca3df34ad6134c9; the project correction was applied as a separate delta.
  • git diff --check and git diff --cached --check: passed for all three commits.
  • npx --no-install markdownlint-cli2 docs/framework/data/adonet/code-access-security.md docs/framework/data/adonet/ef/language-reference/known-issues-and-considerations-in-linq-to-entities.md docs/framework/data/adonet/sql/linq/how-to-connect-to-a-database.md docs/framework/data/adonet/sql/linq/how-to-display-linq-to-sql-commands.md docs/framework/data/adonet/sql/linq/how-to-reuse-a-connection-between-an-ado-net-command-and-a-datacontext.md docs/framework/data/adonet/sql/linq/ado-net-and-linq-to-sql.md docs/framework/data/adonet/ef/edm-generator-edmgen-exe.md docs/framework/data/adonet/ef/entityclient-provider-for-the-entity-framework.md docs/framework/data/adonet/ef/security-considerations.md docs/framework/data/adonet/ef/sqlclient-for-the-entity-framework.md docs/framework/data/adonet/sql/linq/security-in-linq-to-sql.md docs/framework/data/adonet/sql/linq/troubleshooting.md: passed, 12 files, zero issues.
  • Read every changed line in all three commits. git fetch origin main confirmed the intended base at 7a5a9cf8549d2356a135e1686949f4f205cc4843; the branch contains only this independent follow-up, the six-page scope correction, and the project-only CI correction.
  • On Windows, SDK 10.0.402, dotnet build "samples\snippets\visualbasic\VS_Snippets_Data\DP L2E Conceptual Examples\VB\l2e_conceptualexamplesvb.vbproj" --nologo --verbosity quiet -warnaserror:NU1901,NU1902,NU1903,NU1904 -p:RestoreSources=https://packagefeedproxy.microsoft.io/nuget/v3/index.json: passed after the persistent project correction, without reference-path overrides. Zero errors; only existing BC42037 and BC42105 warnings.

The following historical evidence predates the live-correction work and comes from the coordinating session, not new builds or runtime execution by this publishing session:

  • Product-source review of the .NET Framework LINQ to SQL and Entity Framework SQL providers, plus the actual sample EDMX provider declarations.
  • Static comparison rerun after the six-page addition: 31 commented displayed regions and 33 consumer occurrences; executable source, original article text, outputs, headings, and snippet references preserved.
  • Windows, .NET SDK 10.0.402: all ten existing sample projects built. For each project below, the coordinating session ran dotnet build "<project>" --nologo --verbosity quiet -warnaserror:NU1901,NU1902,NU1903,NU1904 -p:RestoreSources=https://packagefeedproxy.microsoft.io/nuget/v3/index.json.
Project Coordinating session result
samples\snippets\csharp\VS_Snippets_ADO.NET\DataWorks SqlClient.CAS\CS\Project.csproj Passed.
samples\snippets\csharp\VS_Snippets_Data\DLinqCommunicatingWithDatabase\cs\CommWithDatabase.csproj Passed.
samples\snippets\csharp\VS_Snippets_Data\DLinqDebuggingSupport\cs\debuggingsupport.csproj Passed.
samples\snippets\csharp\VS_Snippets_Data\DLinqAdoNet\cs\cs-adonet.csproj Passed.
samples\snippets\csharp\VS_Snippets_Data\DP L2E Conceptual Examples\CS\l2e_conceptualexamplescs.csproj Passed.
samples\snippets\visualbasic\VS_Snippets_ADO.NET\DataWorks SqlClient.CAS\VB\Project.vbproj Passed.
samples\snippets\visualbasic\VS_Snippets_Data\DLinqCommunicatingWithDatabase\vb\CommWithDatabase.vbproj Passed.
samples\snippets\visualbasic\VS_Snippets_Data\DLinqDebuggingSupport\vb\debuggingsupport.vbproj Passed.
samples\snippets\visualbasic\VS_Snippets_Data\DLinqAdoNet\vb\vb-adonet.vbproj Passed.
samples\snippets\visualbasic\VS_Snippets_Data\DP L2E Conceptual Examples\VB\l2e_conceptualexamplesvb.vbproj Initial failure: MSB3644, missing .NET Framework 4.0 reference pack. Unchanged project passed after the retry described next.

For the last project, the coordinating session initially restored Microsoft.NETFramework.ReferenceAssemblies.net40 version 1.0.3 in scratch and repeated the build with TargetFrameworkRootPath=$env:USERPROFILE\.nuget\packages\microsoft.netframework.referenceassemblies.net40\1.0.3\build and FrameworkPathOverride=$env:USERPROFILE\.nuget\packages\microsoft.netframework.referenceassemblies.net40\1.0.3\build\.NETFramework\v4.0. That initial retry passed with zero errors and two existing VB warnings, BC42037 and BC42105. However, the scratch override did not persist to CI: the initial remote snippets-build failed with MSB3644 on SDK 11.0.100-rc.2.26504.105.

The project-only correction adds Microsoft.NETFramework.ReferenceAssemblies version 1.0.3 with PrivateAssets="all" and the standard Microsoft.Common.props import. The legacy project also needs an explicit Microsoft.VisualBasic reference and a target before CoreCompile that selects the resolved reference as VBRuntime. The coordinating session then ran a plain build without reference-path overrides, forced restore into a new isolated NuGet cache, and non-incremental Debug and Release builds on SDK 10.0.402: all passed, with only existing BC42037 and BC42105 warnings. Package-audit warnings NU1901-NU1904 were treated as errors. Its evidence is retained in retained-sds-portable-build.log. SDK11 was not installed locally; actual remote snippets CI must confirm that environment. Existing analyzer/legacy warnings remain.

The coordinating session also ran powershell.exe -NoProfile -File <probe-retained-linq.ps1> on Windows 10.0.26300.0, PowerShell 5.1.26100.9711, CLR 4.0.30319.42000. DataContext.Connection returned System.Data.SqlClient.SqlConnection with state Closed, without attempting a SQL connection.

At original publication head 52613a7d4fd74b8c9189c29df9796f7d02f01eef, runtime coverage was unchanged: no new SQL execution, Linux execution, or macOS execution for the then-comment-only source changes. Builds do not claim database behavior coverage. Original build logs, the initial missing-pack failure, successful retry, source evidence, and content manifests are retained in the coordinating session's artifacts.

User-directed live SQL coverage

The original gate was pending; the earlier builds and database-free provider probe did not satisfy it. This publishing session subsequently inventoried and invoked all 31 published C#/VB regions, mapped all 33 consumer occurrences, and separately exercised the CAS permission XML and original net40 database method against 10.0.0.6:1433/test1. This is current-operation coverage with the limits near Summary, not a claim that every region issued successful SQL or that historical bugs were reproduced.

Own client environment: Windows 11 Enterprise build 26300 on ARM64, .NET Framework CLR 4.0.30319.42000, PowerShell 5.1.26100.9711, built-in System.Data.SqlClient from System.Data, Version=4.0.0.0, file version 4.8.10001.0. The original net40 x86 assembly ran in a compiled 32-bit CLR4 host. Actual server identity was recorded for every run: SQL Server 2025, Enterprise Edition: Core-based Licensing (64-bit), EngineEdition=3, product version 17.0.5015.4. Each run used a fresh TCP probe and 45-second login timeout.

Published regions This session's observed result
CAS 1, C# and VB Two expected security denials and one allowed live connection Open in each language.
CommunicatingWithDatabase 1, 2, 5, C# and VB London customer BND01 returned, Paris excluded; the original typed table declaration queried both seeded customers.
CommunicatingWithDatabase 4, C# and VB Shared transaction committed the raw update for ProductID 3 and stock values 17/15 for IDs 4/5. Separate constraint-induced error runs reached both original catches and independently confirmed all three rows unchanged after rollback.
DebuggingSupport 3, C# and VB London query returned Fixture London; GetCommand emitted SELECT and command type.
AdoNet 1, C# and VB Original Close ran on a wrapper-opened live connection and the closed state was asserted.
AdoNet 2, C# and VB Original SubmitChanges wrote staged stock 123; an independent SQL connection read back 123.
AdoNet 3, 4, C# and VB Enumerated original joined/parameter queries and asserted the exact BND01/Fixture London key/name result. The four parent-approved executable fixes passed after the initial failures.
EF SBUDT543840, C# and VB Related-order result count 1 with the seeded model. Historical SQL Server 2005 compatibility-level behavior not reproduced.
EF UIntAsQueryParam, C# and VB Final uninstrumented C# query returned SalesOrderID 48000. VB caught NotSupportedException for UInt32 during translation before SQL.
EF SBUDT555877, C# and VB Queried Contacts, then reproduced the documented unsupported entity-constant translation failure.
EF ProjToAnonType1, ProjToAnonType2, C# and VB Asserted no orders included versus orders included for the two projection forms.
EF SBUDT544355, VB MakeFlag=false returned 0; true reproduced the documented SQL tinyint arithmetic overflow, SQL error 220.

Separate permission XML run: the original permission class/restrictions, with only the connection literal substituted in memory, allowed a live Open and denied a different ApplicationName. Original net40 project evidence is separate: its exact x86 assembly's JoinOnNull returned OrderID48000; copied/original assembly SHA256 was 5052fa1c8badcc217d3c9e3c2dcd2f389a5e9c15c46ae9a25ea69ebd5de8e7df. The earlier full executable exceeded its unattended bound. The 32-bit PowerShell file host was policy-blocked; the successful compiled x86 host changed no execution policy. No completed interactive Main claim is made.

Separate read-only expression observers recorded the exact shown C#/VB predicates, mapped SalesOrderID Int32, and System.Data.Objects.ELinq.ObjectQueryProvider from System.Data.Entity, Version=4.0.0.0. Both comparisons had Int64 operands; C# used Convert nodes, VB ConvertChecked. Observer insertions reverse exactly and are distinct from final original-region executions. The article reports these measured examples without asserting general C# UInt32 support or an unobserved ArgumentException.

Validation copies substituted only authorized connection/fixture identifiers, plus explicitly recorded wrapper setup/assertions and separate observer instrumentation. Unique minimal Northwind/AdventureWorks fixtures replaced production sample databases. Every connection/fixture substitution and model-schema change reverses mechanically; C#/VB EDMX sections match structurally and extracted metadata reverses exactly. No published models changed. Nine inline blocks have explicit XML, expected-output, or command-synopsis dispositions. Every batch dropped its eight unique tables and schema; control connections/pools were closed and temporary credential configuration removed. No server settings or permissions changed.

Own commands/results for the correction:

  • powershell.exe -NoProfile -Command "& '<session-artifacts>\run-live-retained.ps1' -Cases @('case09','case10','case19','case24','case25') -IncludeNet40": all five corrected/join query checks passed; net40 method passed on the subsequent compiled-host retry.
  • powershell.exe -NoProfile -Command "& '<session-artifacts>\run-live-retained.ps1' -Cases @('case04','case19','case31') -RejectProductUpdate -MakeFlagTrue": both rollback assertions passed and VB reproduced its expected SQL overflow.
  • powershell.exe -NoProfile -Command "& '<session-artifacts>\run-live-retained.ps1' -Cases @('case12','case27')": both final original unsigned examples matched their corrected documented outcomes.
  • dotnet build "<project>" --nologo -v:q -warnaserror:NU1901,NU1902,NU1903,NU1904 -p:RestoreSources=https://packagefeedproxy.microsoft.io/nuget/v3/index.json: passed for the four original projects containing the source/comment corrections: C# AdoNet, VB AdoNet, VB CommunicatingWithDatabase, and C# EF, at the exact paths in the historical project table. All 31 extracted-region harnesses and the unchanged net40 project also built on SDK 10.0.402. Initial --no-restore reference-import failures passed after ordinary restore; no repository dependency changes were needed.
  • npx --no-install markdownlint-cli2 - with exact file bytes on stdin, once per article: all 12 actual article inputs passed. git diff --check: passed. Final source/region/model hashes and reversal proofs passed.

Frozen local evidence: retained-live-corrections.patch SHA256 bec5ac20a944fd9240ea9e7f1b408a241b91817dd5691269c4ae05f8f85de65c; export SHA256 b83e095e6bfd5db8d16294c66e207fc05563a398dc548afbab4711005e965e1b; retained-live-sql-ledger.json SHA256 394ef30e4424c9a448df6e85c19674194c7aac195b14ea91caf7d5a15cbdc075. These are this publishing session's runs; earlier coordinating-session evidence remains historical and separately attributed.

Correction-head publication checks

Published correction head: f93168885feb97966fe491827365983edf85e0cd, one normal six-path commit with required trailers. All 23 live PR paths and committed UTF-8/LF-normalized hashes match the frozen ledger; worktree clean. No publication change altered validated source, so no additional SQL run was needed.

gh run view 39482782259 --repo dotnet/docs --log: inspected the fresh successful snippets job. All ten original projects built on SDK 11.0.100-rc.2.26504.105, including the persistent net40 reference-pack fix. Compiler/analyzer warning messages match the preceding published head; no new warning message was introduced.

Downloaded and read the completed OpenPublishing.Build HTML linked below, and verified its Git Commit is the correction head: 23 validated paths succeeded, 12 content pages published, zero errors, zero warnings, ten suggestions. All ten suggestions are outside these 23 paths and match the previous report after timestamps are excluded. No introduced publishing finding required an edit. Markdownlint, dependency review, base-branch, build-verifier, policy, and publishing checks also passed; auto-merge was skipped and the PR remains draft. Earlier reports and build logs remain separate historical evidence.

Related context

Independent follow-up to the approved retained-provider warning requirement. Existing MDS migration drafts remain separate and unchanged: #56458, #56459, #56460, #56461, #56462, and #56463. This PR does not import their migration changes.

No issue is closed by this PR.


Internal previews

Toggle expand/collapse
File Preview link
docs/framework/data/adonet/code-access-security.md Learn preview
docs/framework/data/adonet/ef/edm-generator-edmgen-exe.md Learn preview
docs/framework/data/adonet/ef/entityclient-provider-for-the-entity-framework.md Learn preview
docs/framework/data/adonet/ef/language-reference/known-issues-and-considerations-in-linq-to-entities.md Learn preview
docs/framework/data/adonet/ef/security-considerations.md Learn preview
docs/framework/data/adonet/ef/sqlclient-for-the-entity-framework.md Learn preview
docs/framework/data/adonet/sql/linq/ado-net-and-linq-to-sql.md Learn preview
docs/framework/data/adonet/sql/linq/how-to-connect-to-a-database.md Learn preview
docs/framework/data/adonet/sql/linq/how-to-display-linq-to-sql-commands.md Learn preview
docs/framework/data/adonet/sql/linq/how-to-reuse-a-connection-between-an-ado-net-command-and-a-datacontext.md Learn preview
docs/framework/data/adonet/sql/linq/security-in-linq-to-sql.md Learn preview
docs/framework/data/adonet/sql/linq/troubleshooting.md Learn preview
[samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlClient.CAS/CS/source.cs](https://github.com/dotnet/docs/blob/f93168885feb97966fe491827365983edf85e0cd/samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SqlClient.CAS/CS/source.cs) Learn preview
samples/snippets/csharp/VS_Snippets_Data/DLinqAdoNet/cs/Program.cs Learn preview
samples/snippets/csharp/VS_Snippets_Data/DLinqCommunicatingWithDatabase/cs/Program.cs Learn preview
samples/snippets/csharp/VS_Snippets_Data/DLinqDebuggingSupport/cs/Program.cs Learn preview
[samples/snippets/csharp/VS_Snippets_Data/DP L2E Conceptual Examples/CS/Program.cs](https://github.com/dotnet/docs/blob/f93168885feb97966fe491827365983edf85e0cd/samples/snippets/csharp/VS_Snippets_Data/DP L2E Conceptual Examples/CS/Program.cs) Learn preview
[samples/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks SqlClient.CAS/VB/source.vb](https://github.com/dotnet/docs/blob/f93168885feb97966fe491827365983edf85e0cd/samples/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks SqlClient.CAS/VB/source.vb) Learn preview
samples/snippets/visualbasic/VS_Snippets_Data/DLinqAdoNet/vb/Module1.vb Learn preview
samples/snippets/visualbasic/VS_Snippets_Data/DLinqCommunicatingWithDatabase/vb/Module1.vb Learn preview
samples/snippets/visualbasic/VS_Snippets_Data/DLinqDebuggingSupport/vb/Module1.vb Learn preview
[samples/snippets/visualbasic/VS_Snippets_Data/DP L2E Conceptual Examples/VB/Module1.vb](https://github.com/dotnet/docs/blob/f93168885feb97966fe491827365983edf85e0cd/samples/snippets/visualbasic/VS_Snippets_Data/DP L2E Conceptual Examples/VB/Module1.vb) Learn preview

Build report

Add page notices and displayed sample comments only where .NET Framework integrations require System.Data.SqlClient. Preserve existing executable examples.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: b0a4c59a-563b-44a5-ae83-8c4b9fe56ebc
Copilot AI balanced review requested due to automatic review settings October 20, 2026 00:28
@dotnetrepoman dotnetrepoman Bot added this to the October 2026 milestone Oct 20, 2026
@dotnet-policy-service dotnet-policy-service Bot added dotnet-framework/svc data-access/subsvc community-contribution Indicates PR is created by someone from the .NET community. labels Oct 20, 2026
Add page-only notices to six existing Entity Framework and LINQ to SQL integration articles. Preserve code and avoid artificial snippets.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: b0a4c59a-563b-44a5-ae83-8c4b9fe56ebc

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The notices explain the retained-provider constraints accurately, and the documentation and comment-only changes introduce no blocking issues.

No open issues 🎉

What changed in this PR

Clarifies why legacy .NET Framework examples retain System.Data.SqlClient, while directing new development to Microsoft.Data.SqlClient. Provider migrations remain separate.

Changes:

  • Add notices and metadata updates to six articles.
  • Add prohibition and dependency comments inside displayed C#, Visual Basic, and XML examples.
  • Preserve executable code, snippet references, and project configuration.
File Description
samples/​snippets/​visualbasic/​VS_Snippets_Data/​DP L2E Conceptual Examples/​VB/​Module1.vb Add Entity Framework dependency comments.
samples/​snippets/​visualbasic/​VS_Snippets_Data/​DLinqDebuggingSupport/​vb/​Module1.vb Warn in the command-display example.
samples/​snippets/​visualbasic/​VS_Snippets_Data/​DLinqCommunicatingWithDatabase/​vb/​Module1.vb Add LINQ to SQL connection warnings.
samples/​snippets/​visualbasic/​VS_Snippets_Data/​DLinqAdoNet/​vb/​Module1.vb Add interoperability example warnings.
samples/​snippets/​visualbasic/​VS_Snippets_ADO.NET/​DataWorks SqlClient.CAS/​VB/​source.vb Explain the security example’s provider requirement.
samples/​snippets/​csharp/​VS_Snippets_Data/​DP L2E Conceptual Examples/​CS/​Program.cs Add Entity Framework dependency comments.
samples/​snippets/​csharp/​VS_Snippets_Data/​DLinqDebuggingSupport/​cs/​Program.cs Warn in the command-display example.
samples/​snippets/​csharp/​VS_Snippets_Data/​DLinqCommunicatingWithDatabase/​cs/​Program.cs Add LINQ to SQL connection warnings.
samples/​snippets/​csharp/​VS_Snippets_Data/​DLinqAdoNet/​cs/​Program.cs Add interoperability example warnings.
samples/​snippets/​csharp/​VS_Snippets_ADO.NET/​DataWorks SqlClient.CAS/​CS/​source.cs Explain the security example’s provider requirement.
docs/​framework/​data/​adonet/​sql/​linq/​how-to-reuse-a-connection-between-an-ado-net-command-and-a-datacontext.md Explain shared-connection provider constraints.
docs/​framework/​data/​adonet/​sql/​linq/​how-to-display-linq-to-sql-commands.md Add the retained-provider notice.
docs/​framework/​data/​adonet/​sql/​linq/​how-to-connect-to-a-database.md Clarify LINQ to SQL migration constraints.
docs/​framework/​data/​adonet/​sql/​linq/​ado-net-and-linq-to-sql.md Explain the interoperability provider requirement.
docs/​framework/​data/​adonet/​ef/​language-reference/​known-issues-and-considerations-in-linq-to-entities.md Explain the Entity Framework migration boundary.
docs/​framework/​data/​adonet/​code-access-security.md Add the Framework-only notice and XML comment.

Review effort: Balanced

Restore portable net40 reference assemblies for the legacy VB sample and use the resolved Visual Basic runtime without changing its target framework or sample code.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: b0a4c59a-563b-44a5-ae83-8c4b9fe56ebc
@dlevy-msft-sql

Copy link
Copy Markdown
Author

Final publication checks for head 52613a7d4fd74b8c9189c29df9796f7d02f01eef:

  • GitHub draft remains based on main. The fetched PR head has exactly the final export's 23 paths; all 23 UTF-8/LF-normalized SHA256 hashes match. The changes table has all 23 paths. Worktree is clean.
  • Remote snippets-build passed for all ten projects on Windows with SDK 11.0.100-rc.2.26504.105. I inspected the actual log: the legacy VB net40 project restored and built successfully with only existing BC42037 and BC42105 warnings. This confirms the persistent project correction resolved the earlier CI MSB3644 failure without retargeting or sample removal.
  • Downloaded and read the completed OpenPublishing.Build HTML for this exact head: 0 errors, 0 warnings, 10 suggestions. All 12 published articles and all 23 validated changed files succeeded. All ten docs-link-absolute suggestions concern unchanged paths in _csharplang, _roslyn, or docs/core/tools/dotnetup/concepts/repositories.md; none are introduced by this PR.
  • All active checks passed. The automatic merge job is skipped, and the PR remains draft.

The coordinating session's source review, ten original local builds, isolated-cache Debug/Release checks, and database-free Windows LINQ probe remain attributed to that session in the description. My local checks include exact patch/export comparison, complete diff review, whitespace checks, 12-article Markdown lint, and the corrected VB project's plain SDK10 build without reference-path overrides. No new SQL, Linux, or macOS runtime coverage is claimed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: b0a4c59a-563b-44a5-ae83-8c4b9fe56ebc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Indicates PR is created by someone from the .NET community. data-access/subsvc dotnet-framework/svc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants