Windows error 0x80131904, -2146232060

Detailed Error Information

COR_E_SqlException[1]

Comment System.Data.SqlClient.SqlClientException

HRESULT analysis[2]

FlagsSeverityFailure
Reserved (R)false
OriginMicrosoft
NTSTATUSfalse
Reserved (X)false
FacilityCode19 (0x013)
NameFACILITY_URT[2][3]
DescriptionThe source of the error code is .NET CLR.[2][3]
Error Code6404 (0x1904)

Questions

304votes
18answers

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. The statement has been terminated

I have many users on my web site (20000-60000 per day), which is a download site for mobile files. I have remote access to my server (windows server 2008-R2). I've received "Server is unavailable" errors before, but am now seeing a connection timeout error. I'm not familiar with this - [...] read more
c#
asp.net
sql-server-2008-r2
timeout
sqlcommand
194votes
8answers

"The certificate chain was issued by an authority that is not trusted" when connecting DB in VM Role from Azure website

I am experiencing error when connecting MY DB which is in VM Role(I have SQL VM Role) from Azure Website. Both VM Role and Azure Website are in West zone. I am facing following issue: > SqlException (0x80131904): A connection was successfully established with the server, but then an error [...] read more
azure-web-roles
azure-vm-role
115votes
25answers

There is already an object named in the database

Update-Database failed from Package Manager Console. I've used Entity Framework 6.x and code-first approach. Error is "There is already an object named 'AboutUs' in the database." How can I solve this problem? internal sealed class Configuration : DbMigrationsConfiguration<Jahan.Blog.Web.Mvc.Models.JahanBlogDbContext> { public Configuration() { AutomaticMigrationsEnabled = true; AutomaticMigrationDataLossAllowed = false; } protected [...] read more
database
entity-framework
ef-code-first
entity-framework-6
entity-framework-migrations
51votes
10answers

Win32Exception (0x80004005): The wait operation timed out

I'm running an ASP.NET Web Pages page that upon initial load pulls a list of items from a SQL server. This query runs in a second or so and loads the page within 2 seconds. The return is about a 1000 records, give or take. I'm pulling Hostnames from a [...] read more
sql-server-2008
asp.net-webpages
32votes
13answers

System.Data.SqlClient.SqlException: Invalid object name 'dbo.Projects'

My MVC app is returning SqlExceptions when trying to access any table in my database. Exception Details: System.Data.SqlClient.SqlException: Invalid object name 'dbo.Projects'. My app us linq for the data layer. If I use an old dll it works fine, (so doesn't seem to be a problem with the DB) just [...] read more
asp.net-mvc
linq-to-sql
31votes
10answers

System.Data.SqlClient.SqlException: Login failed for user

Working with my project in debug I have no issues. However running it in IIS I am getting this error: System.Data.SqlClient.SqlException: Login failed for user 'domain\name-PC$'. Stack Trace [SqlException (0x80131904): Login failed for user 'DOMAIN\NAME-PC$'.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +6749670 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +815 System.Data.SqlClient.TdsParser.TryRun(RunBehavior [...] read more
c#
iis
sql-server-2012
connection-string
26votes
3answers

Entity Framework Scaffold-DbContext Login failed for user

I am trying to build an API using Visual Studio 2017 and .NET Core 2 with Entity Framework Core. I am following the directions from This Link. I am on the section titled: Reverse engineer your model The command they give to run is as follows: Scaffold-DbContext "Server=(localdb)\mssqllocaldb;Database=Blogging;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir [...] read more
c#
entity-framework
azure
azure-sql-database
asp.net-core-2.0
7votes
3answers

remote procedure call (RPC) protocol stream is incorrect

I use entityframework 5.0. I have so many test. If I run a test alone it passes, if I run this with the others eachother in the same time, it does not pass. There is no contact between the tests. Everytime one same query was sent. It would not be [...] read more
c#
.net
wpf
entity-framework
tsql
5votes
1answer

Error connecting to MS SQL from one server but not the other

We got a MS SQL server and two web site servers. I'm in the process of moving all the sites from one of the web site servers to the new one. My asp.net sites are not able to connect to the external ms sql server after I've moved them to [...] read more
sql-server
iis
web-server
windows-server-2012
5votes
2answers

SQL Server 2008 R2 Express + Wildcard SSL Certificate

Wildcard certificates (for example, *.example.com) simply did not work in SQL Server 2008 or lower. But Encrypting Connections to SQL Server on MSDN states, plain as day, that > SQL Server 2008 R2 supports wildcards certificates. Excellent. So I set up SQL Server 2008 R2 Express on a machine, and [...] read more
sql-server-2008
ssl-certificate
4votes
1answer

Random connection failures between IIS8 and MSSQL 2012 in RackSpace Cloud

Background For years I hosted all of my server functionality, including IIS, Apache, MySql, and MSSQL on a single server instance, yikes! As my client base grew this led to persistent SQL Timeouts when the server got busy. Over the past year I've reorganized this into three servers, one Windows [...] read more
windows-server-2012
timeout
sql-server-2012
iis-8
.net-4.0
4votes
0answers

SQL Server 2012 Connection Timeout Expired

I am running MS-SQL Server on Windows Server 2012. From time to time I get this Exception: > Server Exception : System.Data.SqlClient.SqlException (0x80131904): Connection Timeout Expired. The timeout period elapsed during the post-login phase. The connection could have timed out while waiting for server to complete the login process and [...] read more
sql-server
windows-server-2012
4votes
2answers

IIS SQL connection fails under heavy load; reset IIS fixes temporarily

Server 1: SQL Server 2008 Standard Edition Server 2: Windows 2008 Server R2, IIS 7.0 A web-site on Server 2 requires data in SQL Server on Server 1. Everything works fine for a while (weeks sometimes). Then, under heavy load, Server 2 reports it cannot connect SQL Server on Server [...] read more
sql-server-2008
iis
connection
4votes
3answers

Can't connect to my own MDF file. Cannot open user default database. Login failed.Login failed for user... and other errors

SQLSEXPRESS service IS running!! I have I program I wrote some time ago and it works. It was written in MS Visual Studio with local MDF file. How is it possible to edit this file from Microsoft SQL Server Management Studio? I don't see this file in the list of [...] read more
sql-server
sharing
mdf
3votes
2answers

How do I disable TLS 1.0 without breaking my IIS/ASP.NET websites?

We are running Windows Server 2008 R2. TLS 1.0 has been non-PCI compliant for some time now, and disabling it via the windows registry is easy. In the past, though, disabling TLS 1.0 has caused 2 problems for us: 1. It's impossible to connect to the server via Remote Desktop. [...] read more
windows-server-2008-r2
iis-6
tls
pci-dss
3votes
0answers

Cannot connect to sql server by IP Address but using the hostname works

After upgrading to the newest version of windows (windows 10 build 10586) I am no longer able to connect to a remote sql server by ip address. Here is the error I see: > [SqlException (0x80131904): Connection Timeout Expired. The timeout period elapsed while attempting to consume the pre-login handshake [...] read more
networking
sql-server
windows-10
3votes
3answers

Scaffold-DbContext "Login Failed" "Error Number:4060,State:1,Class:11"

My ASP.NET MVC core application should connect to an existing MSSQL LocalDB file via Entity Framework. Database-first development requires reverse-engineering the existing database. Following the instructions in the official documentation, I am running the following command in the NuGet Package Manager Console: Scaffold-DbContext "Server=(localdb)\mssqllocaldb;Database=DatabaseName;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models However I am [...] read more
sql-server
asp.net-core
asp.net-core-mvc
entity-framework-core
localdb
3votes
1answer

How can I specify a location to create database files for an Entity Framework Core application?

I have an application using Entity Framework Core to create an SQL Server database and its tables by applying migrations. I need to be able to specify the directory location where the database files will be created. What I want to be able to do is either: 1. Have my [...] read more
c#
sql-server
entity-framework
entity-framework-core
3votes
1answer

EF Migrations - There is already an object named '' in the database

I am having trouble adding a new table to my database. these are the commands I entered when trying to add the new migration: Add-Migration AdminSett > Scaffolding migration 'AdminSett'. The Designer Code for this migration file includes a snapshot of your current Code First model. This snapshot is used [...] read more
c#
entity-framework
migration
entity-framework-migrations
2votes
1answer

System.Web.HttpException: 'Unable to connect to SQL Server database using User.IsInRole("string")

I have this code: if (User.IsInRole("CanManageUsers")) { return RedirectToAction("Index", "Account"); } Which throws the following error: > System.Web.HttpException: 'Unable to connect to SQL Server database' Now I can not figure out why because prior to that I'm successfully connecting to the same database and I fail to understand why in [...] read more
c#
asp.net
asp.net-roles
2votes
1answer

EF core errors to add entities when running within a cycle

I have been dealing with some EF core issues that I cannot identify the source and although I can get around them it's resulting in inefficient code in my opinion. Let me explain, I am calling the below procedure within a cycle after a POST form submission: if (form.Inventory != [...] read more
c#
entity-framework
asp.net-core
entity-framework-core
.net-core-3.1
2votes
1answer

Azure ASP.NET Core POST 400 bad request Blazor Webassembly

I have been trying to deploy my asp.net core hosted blazor webassembly app on Azure App Service, however, I am having trouble getting the api to work. When I try and save a user's data in the database, I get a 400 bad request error. It works fine on localhost. [...] read more
c#
azure
asp.net-core
http-status-code-400
blazor-webassembly
2votes
2answers

Use of Take() LINQ Method in Entity Framework Core v3.1.4

I'm trying to add a limit GET query parameter in my API request (i.e. ?limit=10) and the value of this limit will then be used by the Take() LINQ method to get only the number of results I want. What I want to do is to include the LINQ Take() [...] read more
c#
asp.net-mvc
linq
asp.net-core
entity-framework-core
2votes
3answers

Entity Framework migration error

I added a new table to my existing SQL Server database. I am using its generated id as the key. I ran dotnet ef migration add NewTable, which ran without errors. I reviewed the migration file and this is what was added for my new table: migrationBuilder.CreateTable( name: "InboxNotifications", columns: [...] read more
c#
asp.net
sql-server
entity-framework
1vote
0answers

AZURE_KEY_VAULT provider in SSRS

I've recently set up Always Encryption on an on-prem SQL Server db with the column master key in Azure Key Vault. If I SELECT from the table in SSMS with 'Column Encryption Setting=Enabled' I can read the column in plain text so _I'm pretty confident* the encryption is functioning as [...] read more
encryption
azure
visual-studio-2017
ssrs
1vote
1answer

Dynamics CRM 2011 Import Organization from different locale fails on SQLException

I'm struggling with a Dynamics CRM 2011 , when trying to import an existing organization - coming from a customer's Window Domain, not ours. THE SETUP Two servers. * One windows server 2008 r2 x64 Standard (locale fr-FR) for the Front-end, WebApp and all * One Windows server 2008 r2 [...] read more
microsoft-dynamics-crm
1vote
2answers

How to find missing permission in MS SQL server

Problem description:I am trying to use SQLDependency on a table of a commercial product (TAC Reservation Assistant). The DB is a large Microsoft SQL 2016 database on which we don't have db_owner rights (only TAC does). I am now trying - together with support staff of TAC - to grant [...] read more
sql-server
1vote
0answers

Exception when upgrading organization from crm 4 to 2011- invalid column names

In development and QA environments we've upgraded dozens of organizations from dynamics v.4 to v. 2011 without a hitch. Naturally, when we try to upgrade our first prod organization, we run into a previously unseen error during the import process. It seems like the new schema for the 'Organization' table [...] read more
microsoft-dynamics-crm
1vote
1answer

Team Foundation Server (TFS) 2017 Failing to create backup

So we've had backups running for a few years now, and in the last few days it started backing up extra times. I went to reconfigure the backups to verify the settings and got an error saying it can't backup the dummy database. [Info @12:03:50.669] +-+-+-+-+-| Running Confirming Permissions: Confirming [...] read more
team-foundation-server
1vote
0answers

Azure VPN cannot connect to sql server

We have setup our VPN connection in Azure to our on-premises database, the connect is working with no problems. I have written a MVC app that tries to connect to our on-premise database in SQL Server and am getting the following error: System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred [...] read more
azure
azure-sql
azure-networking
1vote
1answer

Install SQL Server 2017 on Windows 10 Azure VM

I have one Azure Windows 10 VM set up as a workstation which has among other things: * Visual Studio 2017 * Python 2.7 * NodeJS * SQL Server 2017 When a coworker created a new Windows 10 VM and went to install SQL Server, he got an error. I [...] read more
sql-server
virtual-machines
azure
windows-10
1vote
0answers

Windows 2012 R2 Azure VM Cannot Connect To Local SQL Server

I created an Azure virtual machine running Windows Server 2012 R2 that I am using as a web server to host a couple different web sites. This is my first time ever doing something like this and I am struggling to get it to work. I installed IIS 8.5 and [...] read more
windows-server-2012-r2
azure
iis-8.5
1vote
0answers

SQL Connection Problems between two servers

I have two Windows Server 2012 R2 servers HOST1 and HOST2. HOST1 has a web application that talks to a SQL Server 2014 instance on HOST2. When pulling larger amounts of data, notably during scheduled integrations, HOST1 encounters errors that cause processes to fail. There problem is always one of [...] read more
networking
windows-server-2012-r2
1vote
2answers

C#/SQL Server: Login failed when connecting from remote machine

I've got an SQL Server 2008 Express set up on one machine and am trying to connect with my C# app to the server from another machine (both Win 7). The server machine has a user account for me in the system. The SQL Server is configured to use Windows [...] read more
windows-7
sql-server-2008
windows
1vote
1answer

what instance name in connection string for Dynamic management Views

I want to run the following query :: SELECT S.* FROM sys.dm_exec_requests S JOIN sys.dm_exec_sessions R ON r.session_id = s.blocking_session_id It works when i run it in SQL Server Console. But I haven't been able to do the same thru code. I am using the following connection string: "Data Source=localhost\\sqlexpress;Initial [...] read more
sql-server-2008
networking
remote-access
1vote
1answer

Powershell Remoting always logs in as anonymous

I need some help in automating deploying some applications on my domain. The deployment process follows this basic flow in a Powers Shell script: 1. Stop services 2. Copy out applications 3. Log into at least 1 remote server and run "\Services\Shipping\ShippingService.exe /deploy" 4. Start services. I'd like to cut [...] read more
active-directory
powershell
1vote
1answer

EF Core Group By is working on sqlite but not SQL Server

In case I have the following EF Core statement var totalCallsOnHealthRelatedIssue = await _context.CallReasons .Where(cr => cr.Call.IsDeleted != true && (cr.Call.CallStartDateTime >= filterStartDate && cr.Call.CallStartDateTime <= filterEndDate) && cr.Reason.ReasonTypeId == 2) .GroupBy(cr => cr.CallId) .CountAsync(); // Reason: Any type of health issue is counted ReasonType: Health Issue == 2 It [...] read more
sql
sql-server
entity-framework-core
1vote
1answer

Connect to db server from an app server: (0x80131904): Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'

I have two servers: AppServer with IP 192.168.1.2 and DBServer with IP 192.168.1.3 On DBServer I have the database EMSMVC in the DBSERVER\SQLEXPRESS instance. The database is working. On the AppServer in web.config I have: <add name="DefaultConnection" connectionString="Data Source=;Initial Catalog=EMSMVC;Integrated Security=True;Server=192.168.1.3;user id=DBSERVER\admin;password=admin" providerName="System.Data.SqlClient" /> <add name="EMSMVCEntities" connectionString="metadata=res://*/Models.EMSModel.csdl|res://*/Models.EMSModel.ssdl|res://*/Models.EMSModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=DBSERVER\SQLEXPRESS;initial [...] read more
sql-server
asp.net-mvc
iis
1vote
2answers

UWP cannot connect to local SQL Server

I'm creating a simple UWP application working together with my local DB server I set up with SQL Server Management Studio. I can successfully set up a connection in the server explorer and run queries in the DB: SERVER EXPLORER [https://i.stack.imgur.com/rViri.png] However when I run the application I get an [...] read more
sql-server
uwp
1vote
2answers

BizTalk.Operations TerminateInstance SQL Error

I'm getting the following when trying terminate an instance calling TerminateInstance on Operations object: System.Data.SqlClient.SqlException (0x80131904): Conversion failed when converting from a character string to uniqueidentifier. at Microsoft.BizTalk.Database.DatabaseAccessor.ExecuteReader(Int32 procIndex, Object[] procParams) at Microsoft.BizTalk.Operations.OperationsMessageBoxAccessor.ops_OperateOnInstances(Int32 snOperation, Int32 fMultiMessagebox, Guid uidInstanceID, String nvcApplication, Int32 snApplicationOperator, String nvcHost, Int32 snHostOperator, Int32 nServiceClass, Int32 snServiceClassOperator, [...] read more
biztalk
biztalk-2013r2
1vote
1answer

Azure SQL Single Database DTU Timeout Expired Error

I am using Azure SQL Single database DTU purchase model. The average load seems to be under 10%. From time to time I am receiving an error, now it's happening almost each day. I am using EF Core 3.1 for database access. The database is accessed from an API built [...] read more
sql-server
asp.net-core
entity-framework-core
azure-sql-database
azure-appservice
1vote
2answers

ASP.NET [Win32Exception (0x80004005): Access is denied] Error

When I test it in Visuall Studio by pressing F5 and it's working fine and I can able to login the webpage and sql query process working nicely. Also note that my SQL server is active over internet which can be accessed using IP address. But when I publish my [...] read more
c#
asp.net
1vote
2answers

.Net Core Docker Image cannot access database when running in docker

I have a dotnet core application that tries to access to the database, when I run it in visual studio it works fine (probably because of my domain authentication) but when I try to build docker image and run it with docker run -it --rm -p 8080:80 --name console console [...] read more
c#
docker
1vote
0answers

Unable to connect to sql database using System.Data.SqlClient 4.4.3 and hostname but ip works

I have tried running this in a asp.net core 3.1 app inside a docker container based on mcr.microsoft.com/dotnet/core/sdk:3.1-bionic (Ubuntu 18.04). also tried with mcr.microsoft.com/dotnet/core/sdk:3.1-buster. I'm trying to connect to a database with the following code: using var connection = new SqlConnection(connectionString); connection.Open(); If i use an ip adress it works [...] read more
c#
docker
asp.net-core
database-connection
sqlclient
1vote
1answer

ASP.NET Core Web 3.1 - IIS Express can fetch data from localdb but local IIS can not

I have a very weird problem as stated above. The code running is exactly the same, the only difference is the Debug profile used. I'm using Microsoft Visual Studio Community 2019 Version 16.6.3. When using the IIS profile the code says I have no Media in my database. enter image [...] read more
c#
asp.net-core
iis
.net-core
iis-express
1vote
1answer

.NET Core console application with EF Core is not working when run from using dotnet run command, throwing authentication failed exception

I wrote a simple .NET Core console application to explore EF Core using the code first approach and I followed the below steps (windows machine). 1. Create a new .NET Core console application dotnet new console -o CodeFirstDemo 2. cd into the CodeFirstDemo directory cd CodeFirstDemo 3. run the application, [...] read more
c#
.net-core
console
ef-core-3.0
dotnet-cli
1vote
1answer

Docker SQL Server exception

I had a SQL exception while I was running my .NET Core 3.1 Web API project in a Docker container > Microsoft.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name [...] read more
sql-server
docker
asp.net-core-webapi
1vote
1answer

How to solve 'Cannot authenticate using Kerberos' issue doing EF Core database scaffolding in Linux(Ubuntu 18.04)? Are there any solutions?

everyone. I've been trying to develop simple starting AspNetCore application with EntityFrameworkCore to connect and work with MS SQL server database. And manage all this by Rider IDE, tool for Database client(DBeaver) and dotnet command line interface(dotnet ef). I'm using database first approach(create database on mssql server, fill it with [...] read more
asp.net-mvc
ubuntu
kerberos
sql-server-2017
ef-core-3.0
1vote
2answers

Multiple errors when using IIS

I`m recently done my dating app project using angular asp.net-core and SQLserver, and I try to publish the project to IIS. When I run the project locally all the requests get the desirable responses and it work just fine,but when I open the website from IIS server the app is [...] read more
c#
.net
entity-framework
asp.net-core
iis
1vote
1answer

Can not connect to Docker SQL Server from Docker ASP.NET Core 3.1

The main reason why I am asking this is because I have tried literally everything. Here is my configuration: Configuration string "Server=db-server;Database=TestDB;User=sa;Password=Test1234;SslMode=None;" docker-compose: version: "3.5" networks: localdev: name: localdev services: main-api: build: context: . dockerfile: src/TestApp/Dockerfile restart: always ports: - "5001:5001" environment: ASPNETCORE_ENVIRONMENT: "Development" ASPNETCORE_URLS: "http://+:5001" depends_on: - db-server networks: [...] read more
c#
docker
asp.net-core
.net-core
1vote
1answer

Why EF Core is generating the wrong name of the navigation field when creating SELECT clause causing exception?

I have a asp.net core 2.2. project with EF Core. I'm facing this issue. Look at the table below that has two foreign keys: enter image description here [https://i.stack.imgur.com/HKyB0.png] When I run scaffolding, the above table called RubrosContablesCtasBanc, EF created the class and Fluent DbContext as it follows: public partial [...] read more
c#
.net
entity-framework
asp.net-core
entity-framework-core
1vote
1answer

Timeout connecting SQL Server during the post-login phase

I'm getting this error: Microsoft.Data.SqlClient.SqlException (0x80131904): Connection Timeout Expired. The timeout period elapsed during the post-login phase. The connection could have timed out while waiting for server to complete the login process and respond; Or it could have timed out while attempting to create multiple active connections. The duration spent [...] read more
sql-server
asp.net-core
1vote
3answers

Fixed Cannot open database requested by the login. The login failed

I try to execute this web application but it gave me this error messages when I try to register a user account in the web application: > System.Data.SqlClient.SqlException occurred HResult=0x80131904 Message=Cannot open database "rentalsystem" requested by the login. The login failed. Login failed for user 'MicrosoftAccount\corene100@outlook.com'. Source=.Net SqlClient Data Provider [...] read more
c#
asp.net
sql-server
visual-studio
sqlexception
0votes
0answers

Azure Studio connection Error with MS SQL on Linux Mint 19.2

I have MS SQL 2017 running on Linux Mint 19.2. I used "sqlcmd" to verify that it's running, and the reported version is "Microsoft SQL Server 2017 (RTM-CU16) (KB4508218) - 14.0.3223.3 (X64)" However, when I tried connecting to the database server using Azure Studio version 1.10.0 (For Linux) it failed [...] read more
networking
linux-mint
sql-server
0votes
0answers

Sql Exception 0x80131904 cannot log in

My program connects to a MSSql database. If it connects via LAN it works fine, if it connects from outside I get the error message 0x80131904 Error when logging in the user 'ProgProj'. (translation might not be the same as on the english version. On the german version its like [...] read more
login
ms-sql
0votes
1answer

SQL Login fails for app but not for SSMS

I wrote a simple test application in C# (4.5) which does nothing more than connect to a database and display a message. (Basically just to test the deployment and DB connection.) On my local workstation everything works fine. I installed SQL Express 2012, connect as the current user (integrated security), [...] read more
windows-server-2008
.net-framework
sql-server-express
0votes
0answers

An error occurred using the connection to database 'myDb' on server 'tcp:xx.xxx.xxx.xx'. SQLServer - Google Cloud

I'm having a problem deploying my app. The error, below, says that there is an error connecting to the database. Here is my connection string: "Server=tcp:'sql server public IP';Database=MyDB;User Id=sqlserver;Password=passwd" The strange thing is that, when I connect through my local computer, adding a firewall rule, everything is ok, but [...] read more
sql-server
cloud
google
database-connection
0votes
2answers

Active Directory SQL Server Random Handshake Timeouts

We've installed active directory on a new server and joined our database server and web servers to this new domain. However, randomly, we'll get the following error. What would be the cause of the handshake timeout error we're sometimes seeing? The fact that it's not ALWAYS happening to me means [...] read more
active-directory
sql-server
0votes
2answers

Network Exception thrown after session timeout

My site will run fine and I can go through the entire site, but after my session times out, when I make another request to a page I get this exception: Server Error in '/' Application. The system cannot find the file specified Description: An un-handled exception occurred during the [...] read more
networking
database
web-applications
0votes
0answers

Unable to connect to a new installation of sql server

I just installed SQL Server on my Windows Server 2012 R2 box. The installation went well but my apps can't connect to it. If I use the public DNS name for the server in the connection string, the stack trace looks like this: > [Win32Exception (0x80004005): Access is denied] [SqlException [...] read more
sql-server
sql
0votes
1answer

Getting Error while calling a UDF function with function name having special character ampersand in NAGIOS

While calling a UDF function in NAGIOS with function name containing ampersand '&', It returns an error > System.Data.SqlClient.SqlException (0x80131904): The multi-part identifier "dbo.udf_tarrif_t&TT" could not be bound read more
sql-server
0votes
1answer

How to get my VM on Azure to allow in My SQL Connection?

I have a Virtual Machine that is running my web api. I have then created a SQL Database through Azure(this db is not on the VM) and I put that connection string in my application. I get this when I try to run it. What do I need to do [...] read more
windows-server-2008-r2
sql-server
virtual-machines
azure
0votes
1answer

Intermittent DB connection failure

Recently I started to see intermittent errors in log files of my web application. Raising from different places of the application the error is always about failed connection to DB which is located on another server: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The [...] read more
windows-server-2008-r2
sql-server
iis-7
iis-7.5
dotnet-framework
0votes
0answers

Delete TFS Project Collection - SqlException

I'm trying to delete a team project collection in TFS 2010. Unfortunately after struggling with some old instances (some that don't even have databases anymore) I get an error even when attempting to delete a brand new instance. I go through the detatch process and get an error during the [...] read more
team-foundation-server
0votes
1answer

How can I troubleshoot an application connecting to SQL Server

I'm trying to get ASP.net StoreFront to Connect to SQL Server Express 2005, on Windows Server 2008. I followed This Microsoft Support article without success. Below is the error. [SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or [...] read more
windows-server-2008
sql-server
sql-server-2005
0votes
2answers

Hosting Website Issue

I have a web project which I want to post in to our company`s hosting server: IIS Vs.6.0. The name of the server which is running our whole websites is: testing.test.com and domain is testing.com I am added as a User in it as myname@testing.com. Now in the IIS Manager [...] read more
hosting
iis-6
asp.net
web-hosting
windows
0votes
1answer

Login Failed Error when connecting to SQL Server

I am unable to connect to one of the database on our work server. Able to connect to one db but not the other (both hosted on the same server). Connecting through C# .Net Framework Application. Here is the setup. * Server name: MYSQLSERVER * Database 1: mydb1 * Database [...] read more
c#
.net
sql-server
authentication
ssms
0votes
1answer

Connections issue while interactiing with SQL from Azure Function

We are talking to Azure SQL Db using Azure Function. We use latest version of Azure functions which is 3.1 along with .net core 3 and EF core. Recently we saw below error message in our logging Microsoft.Data.SqlClient.SqlException (0x80131904): Resource ID : 1. The request limit for the elastic pool [...] read more
entity-framework
asp.net-core
.net-core
entity-framework-core
azure-functions
0votes
0answers

Having trouble working with UserManager<IdentityUser>

Am trying to create login/registration functionality, I am using user manager but am having trouble figuring it out when my code hits the section where user manager is used I get this error Microsoft.Data.SqlClient.SqlException (0x80131904): Invalid object name 'AspNetUsers'. at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean [...] read more
c#
0votes
1answer

SQL Server Connection Failed with Linux Mint + SQL Server 2008 R2 using AzureDataStudio

I am trying to connect to my SQL Server 2008 R2 with SP4 database, however, I got this error and I have tried some solutions that I found here, but none works for me. PS. I do not know exactly how to understand this error > Microsoft.Data.SqlClient.SqlException (0x80131904): A connection [...] read more
sql-server
openssl
azure-data-studio
0votes
2answers

How to fix " A network-related or instance-specific error occurred while establishing a connection to SQL Server" error in ASP.NET

I published my site on plesk, in login form when I enter username and password I get error. I should say that my login form is based on asp.net configuration and roles and users are set there. > System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection [...] read more
asp.net
sql-server
plesk
0votes
1answer

SQL Server 2016 unique identifier and foreign keys

I have a simple db table that stores actions taken by the user. CREATE TABLE [admin].[AuditRecords] ( [Id] [bigint] IDENTITY(1,1) NOT NULL, [TypeName] [varchar](200) NOT NULL, [IssuedBy] [uniqueidentifier] NOT NULL, [IssuedOn] [datetimeoffset](0) NOT NULL, [Details] [varchar](max) NOT NULL, CONSTRAINT [PK_AuditRecords] PRIMARY KEY CLUSTERED ([Id] ASC) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE [...] read more
sql-server-2016
dapper
0votes
1answer

EF Core Update-Database failing when creating Foreign key

When I run Update-Database I get the following error: fail: Microsoft.EntityFrameworkCore.Database.Command[20102] Failed executing DbCommand (938ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] ALTER TABLE [port_portal] ADD CONSTRAINT [FK_port_portal_port_portal_page_default] FOREIGN KEY ([default_page_id], [organization_id]) REFERENCES [port_portal_page] ([page_id], [organization_id]) ON DELETE NO ACTION; Failed executing DbCommand (938ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] ALTER TABLE [port_portal] ADD CONSTRAINT [FK_port_portal_port_portal_page_default] FOREIGN [...] read more
entity-framework-core
0votes
2answers

Network issue while starting Docker container for dotnet core console application

I have created a simple console application in .NET Core with EF Core executing a SQL Server stored procedure from the server that's accessible only through a VPN connection. I was able to run the application on its own, but the container always exists throwing network error when I start [...] read more
sql-server
docker
.net-core
connection-string
docker-container
0votes
0answers

Connection SqlServer 2012 via Windonws service

I created a windows service for monitoring to send data ( OS info , proc , ram etc) to my sqlserver database it work fine on my computer , I already installed the service in another machine that have sqlserver and it can connect to mydatabase successfully but when the [...] read more
c#
.net
sql-server-2012
windows-services
0votes
2answers

Cascading Referential Integrity Constraints for many to many relationships in EF Core

I'm using EF Core 3.1.5 with Asp.Net Core 3.1. When I'm trying to Add-Migration I get next error: > Microsoft.Data.SqlClient.SqlException (0x80131904): Introducing FOREIGN KEY constraint 'FK_PhotoDevice_Device_DeviceId' on table 'PhotoDevice' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN [...] read more
c#
entity-framework
asp.net-core
entity-framework-core
many-to-many
0votes
1answer

Azure Function timer trigger failed runs execution of stored procedure

I want to execute stored procedure on my azure function timer trigger. The function deployed successfully. But, when the function runs, I get this error stack trace messages Microsoft.Azure.WebJobs.Host.FunctionInvocationException: ... System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw: ... Inner exception System.ComponentModel.Win32Exception handled at System.Data.SqlClient.SqlConnection.OnError: ... Here is the code, [FunctionName("DimensionFactTableUpdate")] public static async Task Run([TimerTrigger("%CronJobSchedule%")]TimerInfo myTimer, [...] read more
c#
.net
sql-server
azure-functions
0votes
0answers

Connection to SQL server fails after evry update of IIS hosted .net core app

We've deployed a .net core 3.1 app to IIS server. The app connects to a SQL server on another VM. After the initial deployment the app had no problems connecting to a database. However, every time we update the app database connections fail with the following exception: Microsoft.Data.SqlClient.SqlException (0x80131904): Connection [...] read more
sql-server
entity-framework
asp.net-core
asp.net-core-webapi
sqlclient
0votes
2answers

Entity Framework 3.1 One-To-Many Insert data

I have Offer and OfferLocation. One offer can have many offer location. While saving offer I also want to save offer locations into offer location table, but I get an error saying: > "Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating the entries. See the inner exception for details.\r\n ---> Microsoft.Data.SqlClient.SqlException (0x80131904): [...] read more
c#
entity-framework
entity-framework-core
0votes
1answer

How to use CASCADE DELETE for removing all tenant data

I want to remove all the entities related to a tenant from the a multi-tenant database when one tenant is removed. I'm working with EF Core and Microsoft SQL Server, although I guess this topic is not limited to those technologies. In this answer, it is said that: > this [...] read more
sql
sql-server
entity-framework-core
cascade
0votes
0answers

Asp.net core in docker Unhandled exception. SqlException (0x80131904): .., but then an error occurred during the pre-login handshake

I'm getting the error "Unhandled exception. Microsoft.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - Unknown error 203)" when I start asp.net core application container using docker-compose in CI/CD flow from gitlab (self-hosted) runner [...] read more
sql-server
asp.net-core
docker-compose
entity-framework-core
gitlab-ci
0votes
0answers

docker mssql container and web api

I followed the steps in this tutorial: https://docs.microsoft.com/en-us/sql/linux/tutorial-restore-backup-in-sql-server-container?view=sql-server-ver15 to create a container with my personal database backup. This part is working correctly and I am able to connect to the database through SSMS using these credentials: * Server Name: localhost,1433 OR 172.0.0.1,1433 (these both work) * Username: sa * Password: [...] read more
sql-server
docker
.net-core
containers
0votes
1answer

Azure SQL Does not allow login for Created Clients

I created several users for Azure SQL using the free acccount in a database in Azure Data Studio following the recommended procedure: * add client ip addresses to firewall * create login on the master database * create users * add appropriate roles that at least encompass db_accessadmin Despite this, [...] read more
sql
azure
azure-sql-database
azure-sql-data-warehouse
azure-sql-managed-instance
0votes
0answers

An error occurred using the connection to database 'myDb' on server 'tcp:xx.xxx.xxx.xx'. SQL Server - Google Cloud

I'm having a problem deploying my app. The error, below, says that there is an error connecting to the database. Here is my connection string: "Server=tcp:'sql server public IP';Database=MyDB;User Id=sqlserver;Password=passwd" The strange thing is that, when I connect through my local computer, adding a firewall rule, everything is ok, but [...] read more
sql-server
google-cloud-sql
0votes
0answers

Unable to authenticate MFA for Azure Conditional Access

I am currently setting up an Azure portal using a free account which I am currently on a Premium 2 trial for Active Directory. Originally I was able to access the database using the credentials of a user called JP01. This user is part of a Database Admin group which [...] read more
sql
azure
azure-active-directory
azure-authentication
mfa
0votes
2answers

Execute a job in SQL Server Agent : login from an untrusted domain

I have an issue with the execution of an SSIS Package within the SQL Server Agent. Context : * I deployed a package into the Integrated Services Catalog : http://i.stack.imgur.com/m9Y9c.png I have not difficult to execute this package manually. Problem : * When I try to execute this package within [...] read more
sql-server
ssis
active-directory
windows-authentication
0votes
1answer

asp.net core 3.0 docker image failing to create

I am using asp.net core 3.0 with sql server, trying to create microservice using docker. However when I tried to run docker-compose I am getting > "An error occurred while migrating or seeding the database." error. I have entity-framework 3.1 migrations in code, when the new database container spins-up I [...] read more
asp.net
docker
asp.net-core
asp.net-web-api
docker-compose
0votes
1answer

How to configure SQL Server docker before docker run in vs19

I have pulled the docker for SQL Server and run it using this command. docker run -e 'ACCEPT_EULA=Y' -e "SA_PASSWORD=12345678Aa" -e "MSSQL_PID=Express" -p 1433:1433 -d mcr.microsoft.com/mssql/server:2017-latest-ubuntu When I try to run my project in Visual Studio via IIS Express,it's running correctly. enter image description here [https://i.stack.imgur.com/7eOEL.png] But I try to [...] read more
.net
sql-server
visual-studio
docker
.net-core
0votes
1answer

Cannot delete Product record after upgrading from Dynamics 365 CRM 8.1 to Dynamics 365 CRM 9

I have tried the following steps in CRM 9: 1. Disabled all the plugins related to Product Entity 2. Created a new Product without any Parent or Child product. 3. Tried deleting the product. This step throws an error. The error I received was: enter image description here [https://i.stack.imgur.com/VDDmP.png] > [...] read more
sql-server
dynamics-crm
microsoft-dynamics
dynamics-crm-online
faultexception
0votes
0answers

The network path was not found in windows 7

when I'm running http://localhost/ in my local PC getting this error. But what does it mean? The network path was not found Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated [...] read more
.net
database
networking
localhost
sqlexception
0votes
1answer

Cannot access ADLS from Synapse Analytics

I have; 1. A master key. 2. A database scoped credential. 3. An external data source. 4. File format. 5. A user created managed identity for Azure SQL Server. 6. RBAC contributor permission for that managed identity on my ADLS storage account. When I execute the code to create an [...] read more
azure-managed-identity
azure-synapse
0votes
0answers

How to properly update multiple records in asp.net core 3.1?

I have an API (PUT) request like the following: {{APIBaseUrl}}/accounts/mappingType The request body looks like the following: [ { "CompanyId" : "AA", "AccountIndex": 134, "Value": "TTTTTTT" }, { "CompanyId" : "A", "AccountIndex": 5148, "Value": "TTTTTTT" }, { "CompanyId" : "B", "AccountIndex": 5146, "Value": "TTTTTTT" } ] The mappingType in the [...] read more
c#
asp.net-core
asp.net-web-api
entity-framework-core
azure-sql-data-warehouse
0votes
0answers

Cannot scaffold DbContext using my local (Azure Ad) credentials

we're using Azure AD to authenticate user and service principals for access to our Azure Sql database. This works fine in my Azure Functions project when running locally via func start or when deployed to Azure, using MSI. Since we're not using the code first approach, there have been some [...] read more
azure
entity-framework-core
azure-active-directory
azure-sql-database
0votes
2answers

.NET and SQL Server container with EF Core and K8s

My goal is to deploy a blazor web application using ASP.NET as the frontend and a SQL Server (on Linux) as the backend. The problem is utilizing the EF Core code because of my embedded connection string: var connectionString = "Server=localhost,1433;Database=HelmDevDb;uid=sa;pwd=27u6DG;MultipleActiveResultSets=true;"; The problem is that within the Blazor application it [...] read more
docker
kubernetes
blazor
kubernetes-helm
ef-core-3.1
0votes
1answer

EPiServer: The wait operation timed out

Versions used: EPiServer 10 (with latest package updates) Visual Studio 2017 15.0.0-RTW+26228.4 Also occurs with VS 2015 Preface: EPiServer is a CMS which allows content types and page types to be defined in code. When those are updated, a task will update respective items in database. When I add or [...] read more
c#
sql-server
asp.net-mvc
episerver
0votes
0answers

MSDTC Issue - Saving Two Related Entities with Disabling Validation

I am getting a MSDTC error every now then and also specially when I execute my code 1st time. Immediately thereafter the code works fine and then errors out after a while again. I am trying to save my entity - hardware along with a related entity - server that [...] read more
entity-framework
entity-framework-6
msdtc
0votes
0answers

Unable to connect to Azure SQL DB Server from Azure Kubernetes Services

I am trying to deploy ASP .Net Core Web API 3.0 in Azure Kubernetes. My Dot Net Core Web API connects to Azure SQL Database. Here are the configuration connection string "ConnectionString": "Server=myservername,1433;Initial Catalog=mydbname;Persist Security Info=False;User ID=userid;Password=*******;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;" Deployment and Service yaml file apiVersion: apps/v1 kind: Deployment metadata: name: my-web-api [...] read more
azure
kubernetes
0votes
0answers

Principal 'xyz' could not be resolved: how can I add a managed identity to Azure SQL Server when running under a Service Principal?

I want to add a managed identity (coming from an App Service) to Azure SQL Server. I created an AAD group where a group of my team and the Service Principal is part of. AzureSqlAdminGroup = TeamGroup + Service Principal This AAD group is added as an Azure SQL admin [...] read more
sql-server
azure-active-directory
azure-sql-server
azure-managed-identity
0votes
1answer

Invalid column name 'id' - this is my error while i am trying to select specific columns from my table

> System.Data.SqlClient.SqlException (0x80131904): Invalid column name 'id'. at System.Data.SqlClient.SqlConnection.OnError Code : try { SqlConnection con = new SqlConnection("Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\\SVB_db.mdf;Integrated Security=True"); con.Open(); SqlCommand cmd = null; string sq = "SELECT event_name, user-id, time_in, time_out, event_date, venue_name FROM Event"; cmd = new SqlCommand(sq, con); SqlDataReader r1 = cmd.ExecuteReader(); if (r1.HasRows) { while [...] read more
sql-server
select
try-catch
0votes
1answer

Why my sql query work with one parameters, but working with another?

I have to simple query public async Task<Posting> GetById(long id) { await using var cnn = new SqlConnection(_settings.Value.ConnectionString); await cnn.OpenAsync(); return await cnn.QueryFirstOrDefaultAsync<Posting>( @"select id from dbo.ArticlePostingLst where id = @id", new { id }); } and another query public async Task<Posting> GetByName(string name) { await using var cnn = [...] read more
c#
sql
dapper
0votes
0answers

Invalid column name exception thrown in .NET Core web api

I have two classes in my database which are defined as classes, fed into entity and then called from the API The full method is below for the calls. The first call works fine, the second throws the exception public async Task<ActionResult<List<QuizForms>>> GetQuiz([FromQuery]string id) { var form = await _context.QuizForms.Where(t=>t.QuizId [...] read more
sql-server
asp.net-core
0votes
0answers

Unable to connect to SQL Server 2019 localdb

I'm part way through writing a .NET Core 3.1 Web API for a project. When I try to connect to the server, postman shows the following message: > Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot open database "aspnet-53bc9b9d-9d6a-45d4-8429-2a2761773502" requested by the login. The login failed. Login failed for user 'DESKTOP-RDBS4OR\Paul'. I've looked around and [...] read more
sql-server
asp.net-core
0votes
0answers

EF core error showing up randomly "The column 'Id' was specified multiple times for 't'.\r\n"

I have this linq query which works perfectly fine but sometimes it throws exception, following is start : query = table.Include(x=>x.table2) after applying few conditions in code finally following is the line which throws exception : var data = await query.Skip(offset).Take(filter.PagingOption.PageSize).AsNoTracking().ToListAsync(); ErrorDetail : System.Data.SqlClient.SqlException (0x80131904): The column 'Id' was specified [...] read more
c#
.net-core
entity-framework-core
ef-core-2.1
0votes
0answers

provider: TCP Provider, error: 0 - The semaphore timeout period has expired

Our .net core Web API is hosted in Azure App service and is connecting to on-premises MS SQL server 2008 using a policy based VPN connection, we are sporadically getting this error.I'm sure this is a network-related error and not a query related error as the query is a simple [...] read more
sql-server
azure
.net-core
azure-appservice
0votes
1answer

sql database azure provider: TCP Provider, error: 0 - This host is not known

I am trying to make a migration. When I make dotnet ef database update --context UsersContext it gives me the following error ( I have two databases and I'm trying to connect to the second one to make the initial migration) Entity Framework Core 2.1.4-rtm-31024 initialized 'ContextUsers' using provider 'Microsoft.EntityFrameworkCore.SqlServer' [...] read more
sql
database
azure
tcp
migration
0votes
0answers

ASP.NET SignalR errors related to SQL failover

Using ASP.NET SignalR 2.4.1 (not ASP.NET Core SignalR), we often experience errors such as the following being logged in the SignalR transport and bus trace logs when testing SQL failover (failing over the SQL Server that hosts the scaled-out SignalR database) (Microsoft SQL Server 2016 (SP2-CU8) hosted on Windows; SignalR [...] read more
signalr
failover
0votes
1answer

SharePoint 2010 Web Part Error - Exception from HRESULT: 0x80131904

A client of ours recently encountered a problem with a web part I wrote a while back. This web part is an advanced search which returns results based on information entered into a text box and the criteria selected from a drop down. This web part has been functional on [...] read more
c#
sharepoint
sharepoint-2010
0votes
1answer

Cannot access Temporary table .NET Core

I'm creating temporary table: var sql = $@" CREATE TABLE #tempImport (Year datetime NULL, Spend decimal (19, 5) NULL, UserId int NULL, Product nvarchar(255) NULL, Margin decimal (19, 5) NULL, ClientId int NOT NULL, Id int IDENTITY(1,1) NOT NULL);"; which I access then like: var sqlConn = new SqlConnection(); sqlConn.ConnectionString [...] read more
c#
sql
sql-server
.net-core
azure-sql-database
0votes
0answers

How to open a downloaded github asp.net mvc project - in visual studio

I have downloaded a project from Github to my pc. Unzipped it and renamed the folder. Now inside the folder I have some files as the below screen shot: enter image description here [https://i.stack.imgur.com/WHEB8.png] So when I tried to open it in visual studio 2019 by selecting the Vidly.sln from [...] read more
c#
asp.net
.net
asp.net-mvc
entity-framework
0votes
1answer

Why this app is trying to connect to SQL Server instead of SQLite?

Environment: VS2019, .NET 4.8, EF 6, SQLite, WPF App (.NET Framework) I am following this Microsoft official tutorial to create a code-first app, called WPF_EF6 using SQLite. With the configuration shown below, I am getting an error about failing to connect to SQL Server. But as you can see in [...] read more
c#
entity-framework
sqlite
entity-framework-6
ef-code-first
0votes
1answer

Connecting to Oracle database using powershell script. Error while connecting

I am trying to connect to a database using the Hostname and SID values through a powershell script. My code: $DataSource ='HOSTNAME:PORT/INSTANCE' $Username='Username' $Password='Password' #List $UserDataDT = New-Object System.Data.DataTable $SQLConnection = New-Object System.Data.SqlClient.SqlConnection $SQLConnection.ConnectionString = "Data Source=$DataSource;User Id=$Username;Password=$Password;" $SQLCmd= New-Object System.Data.SqlClient.SqlCommand $SQLConnection.open(); $SQLCmd.Connection = $SQLConnection $SqlCmd.CommandTimeout = 600 I am [...] read more
sql
powershell
0votes
1answer

IIS can't connect to SQL Server, but an external PC can

My VB.Net code connects to SQL Server. On my PC, it succeeds. On IIS running on the same machine as SQL Server, it fails. Any ideas? I've tested: * I've tried IP address and server name. Same result. * I've tried Integrated Security and I've tried username/password. Same result. * [...] read more
sql-server
vb.net
iis
database-connection
connection-string
0votes
0answers

Error 0x80131904 when adding items to a Sharepoint Online list

I created two custom webparts using react and the pnpjs library: * A Forms Webpart that allows me to consult, add or edit items in lists of my sharepoint site. * A Migration Webpart that allows to migrate list items from my previous sharepoint site to my new one. It [...] read more
reactjs
sharepoint
microsoft-teams
pnp-js
0votes
1answer

context.Database.Migrate(): No connection could be made because the target machine actively refused it?

I cloned https://github.com/dotnet-architecture/eShopOnContainers and try to run some tests. The following method called by the test case raise the exceptions private static void InvokeSeeder<TContext>(Action<TContext, IServiceProvider> seeder, TContext context, IServiceProvider services) where TContext : DbContext { context.Database.Migrate(); // Error seeder(context, services); } Microsoft.Data.SqlClient.SqlException HResult=0x80131904 Message=A network-related or instance-specific error occurred while [...] read more
c#
sql-server
asp.net-core
0votes
2answers

Login failed for user 'DOMAIN\ServerName$' after database connection error

Our website is released to live and running normally for days or even weeks. And then without any change it suddenly starts to throw database connection errors: Error System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Data.SqlClient.SqlException (0x80131904): Login failed for user 'DOMAIN\ServerName$'. at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean [...] read more
linq
iis
linq-to-sql
connection-string
iis-10
0votes
0answers

Job execution error after upgrading from SQL Server 2016 to SQL Server 2019

We have our database in SQL Server 2016 and we restored the same database, packages and jobs in new SQL Server 2019 server instance. We changed the environment variables to point to new server and also pointed new package path in the jobs. While running the job we are getting [...] read more
ssis
sql-server-2016
sql-server-2019
ssis-2016
ssis-2019
0votes
1answer

VB.Net Forms Authentication - Roles.CreateRole()

So I recently started moving my applications over to a more secure authentication system for my un-managed users. I saw Forms authentication for VB.Net and had no issues getting started. I got two new users created and logged in with working password resets. I just tried to use the Roles.CreateRole [...] read more
vb.net
0votes
1answer

C# System.Data.SqlClient.SqlException Cannot insert the value NULL into column ERROR FOREIGN KEY

Error Message showing up after trying to call foreign key, that is a primary key in another table. There's two tables and whats supposed to link them is the foreign key. The SQL Server database does not allow, making the identity of both the primary key and the foreign key [...] read more
c#
sql
sql-server
0votes
0answers

Wrap ef core database update in a transaction

My recent database update failed in the middle of a migration, leaving the database inconsistent: > dotnet ef database update Applying migration '20200429031727_NewRequisitesAndCountry'. Failed executing DbCommand (97ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] [...] Microsoft.Data.SqlClient.SqlException (0x80131904): Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, [...] read more
entity-framework-migrations
ef-core-3.1
0votes
1answer

Can't get local DB to work with application when on another PC

So I have this application I wrote as a little project for work. It uses a single database table that was set up within Visual Studio along with the application itself. And while it runs perfectly fine on my own laptop, I can't get it to work on another PC. [...] read more
sql-server
visual-studio
localdb
0votes
1answer

how to fix The system cannot find the file specified error in ASP.NET MVC and sql server 2019

i create code first application but i running app receive this error and it doesnt make db using sql server 2019 please help me i cant run Server Error in '/' Application. The system cannot find the file specified Description: An unhandled exception occurred during the execution of the current [...] read more
asp.net
asp.net-mvc
entity-framework
0votes
1answer

How to check if database creation in LocalDB is finished

I work on a project with uses SQL Server as database together with Entity Framework Core 3.1. For the unit tests / integration tests we use LocalDB. To ensure the LocalDB database is in the correct migration state, we drop and recreate the test database. This looks something like this: [...] read more
c#
sql-server
unit-testing
localdb
ef-core-3.1
0votes
0answers

Creating an Entity with multiple one-to-many relationship and a DeleteBehavior

I'm using EntityFramework Core version 2.2. I have three entities: Team, Player and Notes. Each team can have a note for each player, so a player may have multiple team that took a note on him. A note can have only one team and one player. public class Team { [...] read more
c#
entity-framework-core
0votes
1answer

Cannot connect to MySQL database from Monodevelop in Linux Mint

I can't connect to a MySQL database from C#. Upon trying to run the executable it spits out this error (this is the beginning of it): Unhandled Exception: System.Data.SqlClient.SqlException (0x80131904): Snix_Connect (provider: SNI_PN7, error: 40 - SNI_ERROR_40) Snix_Connect (provider: SNI_PN7, error: 40 - SNI_ERROR_40) at System.Data.SqlClient.SqlInternalConnectionTds..ctor (System.Data.ProviderBase.DbConnectionPoolIdentity identity, System.Data.SqlClient.SqlConnectionString connectionOptions, [...] read more
c#
mysql
linux
monodevelop
gtk#
0votes
1answer

Using stored procedures with web service in Xamarin

I am working in Xamarin Form ... I create web service ASMX and SQL Server Database, and it works properly. But when I replaced the query by stored procedures there is an error. what I do : First of all, I create class its name DBConnection.cs for connection string public [...] read more
c#
sql-server
web-services
-1votes
1answer

Error in job agent when running a package in SSISDB catalog (SQL Server)

I created a simple package in visual studio. Then I deployed this package in SSISDB catalog which is on a different server. I am using Job agent to execute this package with a proxy account. But I am getting this error in Job Agent: "Excuted as user: *\test**. Microsoft (R) [...] read more
sql-server
ssis
-1votes
1answer

ASP Application on IIS crash

ASP application always hangs and didn't work on IIS during rush hours connections Also other scripts like PHP are working properly on IIS. The problem only with ASP. I'm receiving this error when i'm trying to open the ASP script. ================================================================ Server Error in '/' Application. Timeout expired. The timeout [...] read more
windows-server-2008
iis-7
asp.net
-1votes
0answers

How to access to database in worker service when published as windows service?

I've created worker service on .net core 3.1. I published it to folder and using powershell registered new windows service. When I start service it should connect to database and get records from db. It throws > Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot open database "exmapleDB" requested by the login. The login failed. [...] read more
c#
.net-core
windows-services
ef-core-3.1
-1votes
2answers

Cannot connect to MySQL Server and have no idea why

I am trying to connect to MySQL server Screenshot from MySQL Workbench: Screenshot from MySQL Workbench [https://i.stack.imgur.com/W9ruv.png] using System; using System.Data.SqlClient; namespace C_sharp_test { class Program { static void Main(string[] args) { try { string connectionString = "server=localhost;uid=root;pwd=***********;database=terra_incognita_online"; SqlConnection sqlConnection = new SqlConnection(); sqlConnection.ConnectionString = connectionString; sqlConnection.Open(); Console.WriteLine("open"); sqlConnection.Close(); Console.WriteLine("close"); [...] read more
c#
mysql
sql
ado.net
-1votes
1answer

Blazor, Dapper - A connection was successfully established with the server, but then an error occurred during the pre-login handshake (Error)

I'm fallowing on of the udemy tutorials to connect to MS SQL with Blazor and Dapper. Tutorial connects to localdb but I want to do it with online server that I have. My connection strings are all fine. I can connect to DB with my VS Studio. I dont understand [...] read more
blazor
dapper
asp.net-core-3.1
blazor-server-side
-1votes
0answers

C# how to map Multi Part Column names to class properties?

I have the following Model class: public class Invoice { public string Id{ get; set; } public string BlobInfoContentType { get; set; } } Now the issue is that in my database, the content columns has this name: BlobInfo.ContentType This is how I use it with Dapper: using (SqlConnection connection [...] read more
c#
sql-server
dapper
-1votes
1answer

SQL Server localDB could not create file

i am trying to recreate this sample https://docs.microsoft.com/en-us/ef/ef6/modeling/code-first/migrations/ I did everything according to the text, the program compiles fine, but then it fails creating the database It seems like the db file 'C:\Users\WolfgangConsoleApp4.BlogContext.mdf' is missing a \ after Wolfgang. But I do not know where to enter the path correctly. [...] read more
c#
sql-server
localdb
-2votes
1answer

Incorrect Syntax near '(' SQL Server Query

I am trying to create a table with variables from an ASP.NET form but it shows errors every time. > incorrect Syntax near '(' C# Code: [HttpPost] [ValidateAntiForgeryToken] public async Task<IActionResult> Create([Bind("Id,Title,TableName,IdTab")] SsmsColumn ssmsColumn, string database, string nomtable) { try { if (ModelState.IsValid) { ssmsColumn.Id = Guid.NewGuid(); _context.Add(ssmsColumn); string primaryKey; [...] read more
c#
sql-server
model-view-controller

Comments

Leave a comment

(plain text only)

Sources

  1. https://github.com/dotnet/coreclr/blob/v1.1.0/src/inc/corerror.xml
  2. https://msdn.microsoft.com/en-us/library/cc231198.aspx
  3. winerror.h from Windows SDK 10.0.14393.0

User contributions licensed under CC BY-SA 3.0