Questions tagged [microsoft-data-sqlclient]
27 questions
5
votes
2 answers
Does the nuget package Microsoft.Data.SqlClient work with Entity Framework?
My application runs on .NET framework 4.7 and I'm using Entity Framework 6.1.3. Currently, my code uses some classes from the namespace System.Data.SqlClient such as SqlParameter. I want to switch to Microsoft.Data.SqlClient.
However, I'm not sure…

Suraj Patil
- 85
- 1
- 5
4
votes
2 answers
Microsoft.Data.SqlClient.SqlConnection.OpenAsync throws error saying "The given key was not present in the dictionary."
This error started suddenly after upgrading Microsoft.Data.SqlClient from v2 to v4. Reverting the code back had no effect and the error persists.
It's a basic connection string with a data source, initial catalog, username, password, and MARS.…

Triynko
- 18,766
- 21
- 107
- 173
4
votes
1 answer
Unable to load DLL 'Microsoft.Data.SqlClient.SNI.x86.dll' from Unit Tests when using Microsoft.Data.SqlClient 2.0
When using the Microsoft.Data.SqlClient package (version 2.0) in my code I get the following error when Unit Tests are executed via VSTest.console.exe in our CI provider (and when ran locally):
System.TypeInitializationException: The type…

Chris
- 3,081
- 3
- 32
- 37
2
votes
0 answers
Using Microsoft.Data.SqlClient in PowerShell
I would like to use the Microsoft.Data.SqlClient namespace/ objects in a PowerShell script.
Two (click1, click2) Github posts provide a way to load the correct dll's, but the solutions don't seem to work anymore.
E.g. result of the first solution…

Odrai
- 2,163
- 2
- 31
- 62
2
votes
0 answers
How to get Microsoft.Data.SqlClient to work with DataSet Designer?
Quite simply, how do you get Datasets Designer in visual studio to use Microsoft.Data.SqlClient as a provider?
I did the following in a NetStandard2.0 Project.
Add nuget Microsoft.Data.SqlClient
Add new Dataset to project.
Opened the dataset…

Gaz83
- 2,293
- 4
- 32
- 57
1
vote
1 answer
How to reuse lambda expression on entities with different property names in EF Core with MS Data Sync?
In ASP.Net EF Core I have various entity models with corresponding controllers which inherit from Microsoft.AspNetCore.DataSync.TableController and each model inherits EntityTableData from the same DataSync library so as to facilitate the Offline…

RyanO
- 21
- 4
1
vote
1 answer
MAUI Android unable to connect to SQL Server
This error is seen multiple times on the internet but no satisfactory solution is given.
Connection with Microsoft.Data.SqlClient produce a SqlException (0x80131904): A connection was successfully established with the server, but then an error…

PaulDurant
- 51
- 1
- 4
1
vote
0 answers
capricious System.AccessViolationException on Net 7 project
We have a mid-size solution holding projects targeting Net 7, NetStandard 2.1 and Blazor.
Some time ago it raised a System.AccessViolationException exception, by that time, we search for changes in our code and were able to workaround it removing…

Mauricio
- 43
- 5
1
vote
0 answers
Why is Visual Studio adding spaces to connection strings during a *Schema Compare* aka .scmp files?
Visual Studio is adding random spaces in my connection string when doing a schema compare. Anyone know why?
ConnectionString-xml-element-diff.txt:
old: MultipleActiveResultSets=False;Connect Timeout=10;TrustServerCertificate=False;
new: Multiple…

yzorg
- 4,224
- 3
- 39
- 57
1
vote
1 answer
What happens when you make more database requests than the pool of available SQL connections?
As far as I'm aware, in ASP.NET Core when creating SqlConnection's they are fetched from a pool of already open such connections, as the operation for opening a single connection is very costly and expensive, so we're effectively re-using these…

SpiritBob
- 2,355
- 3
- 24
- 62
1
vote
1 answer
How does SqlClient gets 'scope' of Azure SQL Server when using Azure Active Directory as authentication method?
As I understand that for getting selective authorization for a protected resource using Azure AD based OAuth 2.0 mechanism, client application need to mandatorily provide the scope URL for getting access token.
Other parameters usually include…

A. Trivedi
- 33
- 3
1
vote
1 answer
This keeps happening - Microsoft.Data.SqlClient.resources.dll is not found during .NET Core 3.1 debug session in Visual Studio 2019
This keeps happening - Microsoft.Data.SqlClient.resources.dll is not found during .NET Core 3.1 debug session in Visual Studio 2019
Exception message:
"Could not load file or assembly…

EnocNRoll - AnandaGopal Pardue
- 3,832
- 2
- 23
- 26
1
vote
2 answers
Azure release pipeline (YAML) IIS web deploy fails on locked files generating ERROR_FILE_IN_USE
Actual
Release pipeline fails when deploying
Expected
Deploy does not fail
Root cause
File 'Microsoft.Data.SqlClient.SNI.x86.dll' is locked locked by an external process, even when 'Take App Offline Flag' setting is on
Workaround
Recycle application…

Bart VdA
- 578
- 1
- 5
- 15
0
votes
2 answers
NullReferenceException in F# interactive
I'm using microsoft.data.sqlclient library. I’m trying to execute this simple code in F# interactive:
#r @"C:\Users\micha\.nuget\packages\microsoft.data.sqlclient\5.1.0\ref\net6.0\Microsoft.Data.SqlClient.dll"
open Microsoft.Data.SqlClient
let…

Michael Samoilenko
- 45
- 6
0
votes
1 answer
SqlException: Login failed for user ''
I'm using below connection string to connect AZURE SQL server, however We see below error. Please advice
Connection string: Data Source=servername.database.windows.net;Encrypt=True;Initial Catalog=dbname; Authentication=Active Directory Service…

Vigneash Selvaraj
- 57
- 1
- 5