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

297votes
17answers

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
188votes
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
113votes
24answers

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
55votes
7answers

How to add LocalDB to Visual Studio 2015 Community's SQL Server Object Explorer?

PROBLEM I don't understand how to make LocalDB show up in the SQL Server Object Explorer. On some VMs, it shows up automatically, on some other VMs, it doesn't. Still, after googling for hours, I don't get it. CURRENT SITUATION 1. I have a clean VM 2. I installed Visual [...] read more
sql-server
visual-studio-2015
localdb
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
31votes
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
10votes
3answers

Specify Azure SQL server edition in EF Core without breaking local development

Entity Framework Core introduced the methods HasServiceTier and HasPerformanceLevel to change the edition of an Azure SQL server. You can use them in OnModelCreating like this: protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); modelBuilder.HasServiceTier("Basic"); modelBuilder.HasPerformanceLevel("Basic"); } If you use Add-Migration Add-Migration you get a migration like this: public partial class [...] read more
c#
azure
entity-framework
entity-framework-core
9votes
4answers

.NET Core can´t connect to SQL DB

I build a new .net Core Web API with connection to SQL DB. I have problems to connect the API with my Database I tried a local DB "DefaultConnection": "Server=(localdb)\\MSSQLLocalDB; Initial Catalog=ib; Integrated Security=SSPI", and a remote (see appsettings.json). Remote: Microsoft SQL Server Express (64-bit) 11.0.2100.60 System: Microsoft Windows NT [...] read more
c#
asp.net-core
8votes
3answers

Azure: Login failed for user

What I have done: * I added Resource group in Azure. * Added Web Service with previous resource group. * Added SQL Server Database with previous resource group. * Retrieved generated connection string from this database and provided here username and password. * Added this connection string to App Settings [...] read more
.net
sql-server
database
azure
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
5votes
8answers

Azure Web App Error, No such host is known

When Running the web App locally there is no issue to connect to the DB, after deploying the Web App to Azure the DB(Also Azure) connection attempt throws the following error: [Win32Exception (0x80004005): No such host is known] [SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection [...] read more
asp.net
azure
azure-sql-database
azure-web-sites
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
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
4votes
8answers

A connection was successfully established with the server, but then an error occurred - provider: TCP Provider, error: 0

My web site was working flawless in the old Host, But now i Moved to a new host Please pay attention: The Old host was a VPS on the same host So i'v stoped paying him and now i'm hosting on the same host as a shared host. So I [...] read more
tcp
system
provider
sqlexception
sqlclient
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
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
3votes
2answers

EF Core There is already an object named 'AspNetRoles' in the database

I am receiving There is already an object named AspNetRoles in the database. error while attempting to use update-database command in NuGet console. Context: public class ApplicationDbContext : IdentityDbContext<IdentityUser> { public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : base(options) { } public DbSet<Customer> Customers { get; set; } } Startup: public class Startup { [...] read more
c#
entity-framework
asp.net-core
entity-framework-core
asp.net-identity
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
2votes
1answer

How to reference host port from docker container in MSSQL Server connection string?

Orchestration: * Windows Host * My DB is running in a container on localhost:1444. * My API is running in a container on localhost:5000/5001. * They are both running on the default (bridge) network. * I can't use a custom network because currently our app references another API that is [...] read more
windows
.net-core
network-programming
sql-server-2017
docker-desktop
2votes
1answer

Identity Server 4 loggs (Invalid object name 'DeviceCodes') exception

We are using Identity Server 4 for authentication. After upgrading our solution from .Net Core 2.0 to .Net Core 3.1, we started to notice a new exception be logged when a client redirects to our authentication URL, which did not effect the process and everything seems OK for the end [...] read more
authentication
asp.net-core
exception
client-server
identityserver4
2votes
4answers

How to wait for MSSQL in Docker Compose?

I have a service (an ASP.NET Core Web application) that depends on MSSQL. The services are orchestrated using Docker compose, and I want docker compose to first start the database and wait for it to be ready before running my service. For that, I am defining the docker-compose.yml as: version: [...] read more
c#
sql-server
docker
asp.net-core
docker-compose
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

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

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
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
1vote
1answer

.NET Core on Azure can't connect to SQL Server Database

I have a .NET Core API backend which is published on Azure. I also have a SQL Server database running on Azure, if I run my backend app locally it succesfully connects to the online database, reading/writing etc works fine. When running the online backend however, every API call results [...] read more
.net
sql-server
azure
core
1vote
0answers

When Building my exe it cant find my database

When I build my project on the computer with Visual basic my exe file works but as soon as I open the exe on my server I get an error that I think it doesn't my database. Doesn't this get compiled at the same time as my whole program? I [...] read more
vb.net
visual-studio
1vote
1answer

Blazor - The INSERT statement conflicted with the FOREIGN KEY constraint

I'm getting the conflicted error message on my foreign key table, however, the drop-down menu populates the course category ID, an INT field as a number but the column is bound on InputText, as a string instead of InputNumber, although io tried using the InputNumber data type on the razor [...] read more
c#
asp.net
razor
blazor
1vote
1answer

Entity Framework get SUM from child property

I have the following model where I'd like to get the sum of all OrderTotalItems for all Orders of a Customer where the OrderTotalType (Enumeration) is "total" or 99: public class Customer { ... public ICollection<Order> Orders { get; set; } = new Collection<Order>(); } public class Order { ... [...] read more
c#
entity-framework
entity-framework-core
1vote
0answers

Error in Exporting Created Models to Database in EDM

I already had a Users table on the database with the following columns and data types * Id - Int * username - varchar(MAX) * password - varchar(MAX) * RefreshToken - varchar(MAX) Then I added several columns to it as shown below. public class User { public User() { this.FollwedBies [...] read more
c#
sql-server
edmx
1vote
2answers

Execute Reader wait operation time out error

stuck on this since few days please help. I have tried a lot of solutions like increase connection timeout in web config: below is my error code. Server Error in '/' Application. The wait operation timed out Description: An unhandled exception occurred during the execution of the current web request. [...] read more
c#
sql
asp.net
.net
executereader
1vote
1answer

DbUpdateException error trying to use EF core code first

I have a simple Web API and I am trying to use entity framework core code first, with an external sql server database hosted on AWS RDS. My aim is for EF to create my model database/tables automatically, based on my context and models, the first time I use Swagger [...] read more
c#
asp.net
amazon-web-services
asp.net-web-api
1vote
1answer

dotnet core 3.1 web api development sql connection fail on server

fail: Microsoft.EntityFrameworkCore.Database.Connection[20004] An error occurred using the connection to database 'databaseName' on server 'domainName'. fail: Microsoft.EntityFrameworkCore.Query[10100] I have developed a web api with dotnet core 3.1 on macbook. I used Scaffold-DbContext "Connection String" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models to connect to the existing database on a server. On local everything works fine [...] read more
.net
asp.net-core
asp.net-core-webapi
asp.net-core-3.1
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
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

Failure obtaining db row lock: Execution Timeout Expired What this error describes

Quartz.Impl.AdoJobStore.LockException: Failure obtaining db row lock: Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. The statement has been terminated. ---> System.Data.SqlClient.SqlException: Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not [...] read more
database
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
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

.NET and MSSQL Container with EF Core and K8s

My goal is to deploy a blazor web application using ASP.NET as the frontend and a MSSQL-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 either has to [...] read more
docker
kubernetes
blazor
kubernetes-helm
ef-core-3.1
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
httprequest
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
entity-framework-core
azure-active-directory
azure-sql-database
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

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
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
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

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
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
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

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
0votes
1answer

Entity Framework Fluent API - Cascade Delete - With Interface

I've got the following relationships defined in my data model / Entity Framework-driven (EFCore) database: 1. A Person.cs which implements the IRecord interface. A Person has a List of ExternalId.cs objects. 2. The ExternalId.cs class has an inverse property back to the IRecord interface. This is a one-to-many relationship (one [...] read more
c#
sql-server
entity-framework
entity-framework-core
0votes
1answer

Deploy ASP.NET MVC app on Azure portal with SQL database

How I can move my local database in project in order that I can deploy this database to Azure? Know on Azure when I login I get an error: > Error: an error occurred while processing your request It is because I have no connection to my database. I have [...] read more
c#
asp.net-mvc
visual-studio
azure
azure-sql-database
0votes
0answers

Fatal NServiceBus exception when starting endpoint, cannot open database

We just made some changes to our project and deployed it. We have 7 endpoint databases in our SQL Server database for NServiceBus. We recently added 2 more. One of the two services using one of the two new endpoints fails to start. When looking at our log file we [...] read more
c#
sql-server
nservicebus
0votes
1answer

Deleting a listing in table throws a SQL error

I have a .NetCore Entity Framework project for a model airport. When I try to delete an airport in the listings, I am getting the error below when trying to delete an airline and I'm trying to figure out why: Microsoft.Data.SqlClient.SqlException (0x80131904): The DELETE statement conflicted with the REFERENCE constraint [...] read more
entity-framework
asp.net-core
entity-framework-core
asp.net-core-webapi
asp.net-core-3.0
0votes
0answers

Error Invalid object name attempt to connect to a non-existent database table

I’m doing a diplom project on the Acp.Net core mvc 5 platform. I created a role provider. I try in the method public override string [] GetRolesForUser (string username) to get user roles, here is the method itself public override string[] GetRolesForUser(string username) { string[] roles = new string[] { [...] read more
asp.net-mvc-5
entity-framework-core
0votes
1answer

Azure database works on localhost, but not when used with azure service app

So I've been trying to publish my first project to azure. I've got everything set-up, a service app and a sql database. My initial page loads properly(It's the standard view for a .net core web application). The first thing I need to do is register a new user. Whenever I [...] read more
entity-framework-core
azure-sql-database
azure-web-sites
0votes
0answers

Can't access Azure sql with EF Core - Code first, but can with database first

so as the title suggests. I have done the following: Created simple models (c# classes). Added Nugget packages: - Microsoft.EntityFrameworkCore.Design(3.1.3) - Microsoft.EntityFrameworkCore.SqlServer(3.1.3) I Have added the following context: namespace PriceCalendarService.Data { public class DataContext : DbContext { public DataContext(DbContextOptions<DataContext> options) : base(options) { } public DbSet<Item> Items { get; set; [...] read more
asp.net
entity-framework
entity-framework-core
azure-sql-database
azure-sql-server
0votes
2answers

EF Core 2: The MERGE statement conflicted with the FOREIGN KEY constraint

I have following classes: public class GSProject { public int Id { get; set; } public ICollection<GSPoint> Points { get; set; } public ICollection<GSPlanarSurface> PlanarSurfaces { get; set; } } public class GSPoint { public int Id { get; set; } public int? PlanarSurfaceId { get; set; } public GSPlanarSurface [...] read more
c#
tsql
entity-framework-core
.net-core-2.0
0votes
1answer

How to fix EF Core database errors after extending IdentityUser in ASP.NET Core 3.1?

I've built a web app in ASP.NET Core 3.1, using Entity Framework Core 3.1 as well, and am now trying to Publish it to Azure. However, at the point in development when I extended the built-in IdentityUser class with a custom ApplicationUser class, my EF migrations stopped posting to the [...] read more
sql-server
tsql
asp.net-core
asp.net-core-mvc
entity-framework-core-3.1
0votes
1answer

Select table using ListBox

I'm trying to read tables in an SQL statement. The names of the Tables, are pulled in a listbox. Users will select the name of the table they want to view the data for, and in turn my method will read+visualize+export that table. The issue is with the name of [...] read more
c#
sql
sql-server
tsql
ado.net
0votes
1answer

EF Core Code-First Migration Changing Primary Key from Int to Long Failed

I'm using Dotnet Core 3.1 with Entity Framework Core 3.1.3 using Code-First with Azure SQL Database. During the development, I want to change the Primary Key of a table from int to long from the Model class in dotnet core project and use add-migration. However, when using Update-Database, there are [...] read more
.net-core
entity-framework-core
azure-sql-database
0votes
1answer

Installation 2SexyContent in Dnn Portal (dnnSoftware)

When I install 2sxc in DnnSoftware in recent versions I got the following error message. My provider has SQL Server switch to "czech_CI_AS" I can´t this change to US-language. Does anyone have advice? SqlDataProvider Info Created - SqlDataProvider\00.99.00.SqlDataProvider Info Executing 00.99.00.SqlDataProvider Info Start Sql execution: 00.99.00.SqlDataProvider file Failure SQL Execution [...] read more
installation
2sxc
dnn9
0votes
2answers

C# - SQL Server: INSERT statement conflicted with FOREIGN KEY constraint - Unhandled Exception

I wrote a small C# application, which reads an Excel file and should import the data into an existing SQL Server database. As there is a foreign key constraint in the table the entries should be inserted to, I already prevented this error directly in my SQL query by using [...] read more
c#
sql-server
constraints
thread-exceptions
0votes
1answer

How to attach mssql database using relative path?

Sorry if this's been already asked! I am able to attach a mssql database on button click using this code: using (SqlConnection connection = new SqlConnection(@"Data Source=.\SQLEXPRESS;Initial Catalog=;Integrated Security=True; MultipleActiveResultSets = true")) { using (SqlCommand cmd = new SqlCommand("", connection)) { using (SqlCommand cmd1 = new SqlCommand("", connection)) { try [...] read more
c#
winforms
0votes
0answers

Not able to search a document library on sharepoint with more than 500 records

I am using sharepoint 2016 online. My document library has more than 500 documents. I am trying to fetch records with the below caml query : <View><Query><Where><And><Eq><FieldRef Name='ContextId'/><Value Type='Integer'>xxxxxxxx</Value></Eq><Eq><FieldRef Name='NumericRecordId'/><Value Type='Integer'>xxxxx</Value></Eq></And></Where></Query</View> var list = context.Web.Lists.GetByTitle(listName); var collection = list.GetItems(query); context.Load(collection); context.Load(collection, f => f.Include(i => i.File)); context.ExecuteQueryWithIncrementalRetry(); return from c [...] read more
sharepoint
sharepoint-online
0votes
1answer

ASP.NET Core 3 EF Framework - transient failure when running lots of queries

I am using EF Core for an ASP.NET website. In one method I have about 7 complex queries similar to (simple example): var query1 = context.Playarea .Include(x => x.Cats) .Where(x => x.Cats.Any()) .SelectMany(x => x.Cats.Select(y => new MyClass(x.Id, y.Name, y.Age))).ToList(); var query2 = context.Playarea .Include( x => x.Dogs) .Where(x => [...] read more
entity-framework
asp.net-core-3.0
0votes
0answers

Published windows app not connecting to LocalDB

I have a windows application in C#, works fine on my laptop even when published but as soon as I send it to another machine, it gives this error "System.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 [...] read more
c#
sql-server
windows
windows-installer
localdb
0votes
0answers

ASP.NET Core - cannot "dotnet ef database update" to migrate, but CL throws "CREATE DATABASE permission denied in database 'master'."

I am trying to create a database and connect it with my ASP.NET Core app. I am using Mac, so the setup I followed is this tutorial, https://www.ciclosoftware.com/2018/03/14/sql-server-with-net-core-and-entityframework-on-mac/ When I use "dotnet ef database update" in my command line, I get errors saying Failed executing DbCommand (19ms) [Parameters=[], CommandType='Text', CommandTimeout='60'] [...] read more
sql
.net
sql-server
asp.net-core
0votes
0answers

Access/Query SQLServer within Docker on Mac using c#/visual studio

I am new to development and C# - working on a MAC with Visual Studio Community - I installed Docker and installed MSSQL Linux within Docker. I created a database, added tables using Azure Data Studio. I can query the database from Azure. I want to connect to the SQL [...] read more
c#
sql-server
macos
docker
0votes
0answers

dbup for Azure sql datawarehouse?

Does Dbup support the azure datawarehouse DB? When i tried to run the c# console project, even for select statement, i am getting the below error, any advice appreciated? is there any alternative sql automation version like dbup, apart from dacpac. [error]Script block number: -1; Message: Enforced unique constraints are [...] read more
azure
azure-sql-data-warehouse
dbup
0votes
1answer

Trouble connecting to DB in .NET Core app while following tutorial

Ok, here's my issue. I'm following the tutorial here: https://docs.microsoft.com/en-us/aspnet/core/data/ef-rp/intro?view=aspnetcore-2.2&tabs=visual-studio And when I get to the section where you first test the app, I get a connection error for my database. I haven't touched the connection string (the tutorial doesn't say to). But the error I get is this (through [...] read more
.net-core
0votes
0answers

provider: SSL Provider, error: 0 - An existing connection was forcibly closed by the remote host

In short, I wrote a console app that just calls a stored procedure in a SQL Server database. Then setup a Windows Task Scheduler event to call the console app's .exe file every 5 minutes. Most of the time it works, however about 10 times a day or so we [...] read more
sql-server
ssl
sqlexception
0votes
2answers

Error on UWP trying to connect to SQL Server Express via EFCore

Team, this is driving me crazy. I always receive this error when I start the UWP application: > Microsoft.Data.SqlClient.SqlException: '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 is correct and that [...] read more
sql-server
uwp
entity-framework-core
database-connection
ef-core-3.0
0votes
0answers

ASP.NET machinekey settings causing error on Firefox but working on Internet Explorer

Previously we are experiencing frequent "Validation of viewstate MAC failed." error. Our app is deloyed on a web farm, and we found out that to fix this we should add machinekey settings on our web.config. After adding machinekey settings to our config, On Firefox, we are now experiencing an error [...] read more
asp.net
iis
machinekey
0votes
0answers

MS SQL Server with EF Core 'Introducing FOREIGN KEY constraint may cause cycles or multiple cascade paths' with Delete Behavior SetNull

I really thought I'd understood the EF Core delete behavior constraints concerning MS SQL Server, but obviously I don't :-( Introducing a foreign key with delete behavior "set null" leads to the following exception when updating the database: > ALTER TABLE [AppointmentParticipations] ADD CONSTRAINT [FK_AppointmentParticipations_SelectValueMappings_ResultId] FOREIGN KEY ([ResultId]) REFERENCES [SelectValueMappings] [...] read more
c#
sql-server
entity-framework-core
ef-core-3.1
-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
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
-1votes
1answer

Login failed for user ( with trusted connection EF Core) How do I create missing database?

How do I create a database if it is missing ? Using Microsoft.EntityFrameworkCore In EF6 I could use Database.SetInitializer<apiDBContext>(new CreateDatabaseIfNotExists<apiDBContext>()); I found a way but am not sure if it is the best. The following test fails using Microsoft.VisualStudio.TestTools.UnitTesting; using Dogs; namespace UnitTestProject1 { [TestClass] public class UnitTest1 { [TestMethod] [...] read more
sql-server
entity-framework-core
-3votes
0answers

Error in creating database using Azure Data studio

I downloaded Azure Data studio via Docker. And was trying to create a database using NuGet Package Manager Console on visual studio on mac. Typed in "PM> update-database" The following error massage appeared. Build started... Build succeeded. Microsoft.Data.SqlClient.SqlException (0x80131904): Login failed for user ''. at Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential [...] read more
sql-server
visual-studio-mac
azure-data-studio

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