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

253votes
11answers

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
122votes
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
88votes
13answers

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
code-first-migrations
80votes
7answers

Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'

I am using WinHost.com to host my site. The SQL Database/membership system works perfectly on my local computer, but when uploaded to the server it doesn't work. I've followed all steps correctly. And I have contacted support for my service but it's been over 2weeks and no reply. I keep [...] read more
sql
sql-server
stored-procedures
47votes
13answers

Error message: (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)

I am trying to deploy my website on windows server 2003. Am i missing something or what is wrong from the following error message, how can I correct it? Thank I am having the error message: > A connection was successfully established with the server, but then an error occurred [...] read more
sql
asp.net-mvc
windows-server-2003
sql-server-2005-express
38votes
8answers

How to solve "unable to switch the encoding" error when inserting XML into SQL Server

I'm trying to insert into XML column (SQL SERVER 2008 R2), but the server's complaining: > System.Data.SqlClient.SqlException (0x80131904): XML parsing: line 1, character 39, unable to switch the encoding I found out that the XML column has to be UTF-16 in order for the insert to succeed. The code I'm [...] read more
.net
sql-server
xml
utf-8
utf-16
29votes
7answers

The network path was not found

I'm running my code and 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 in the [...] read more
.net
database
networking
23votes
8answers

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 'CAPLUGSLLC\OETINGER-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
21votes
6answers

Paging with Entity Framework 7 and SQL Server 2008

I'm trying to use paging (that is .Skip(...).Take(...) in Entity Framework 7. It works OK with Microsoft SQL Server 2012 and 2014, but fails with the following error on SQL Server 2008: > System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near 'OFFSET'. Invalid usage of the option NEXT in the FETCH statement. I've [...] read more
asp.net-mvc
sql-server-2008
paging
entity-framework-core
10votes
6answers

Currently, All my SQL Request showing "System.ComponentModel.Win32Exception: The wait operation timed out"

Suddenly, all of sql server requests showing "System.ComponentModel.Win32Exception: The wait operation timed out". What is the quickest way to find the issue? Stack Trace: [Win32Exception (0x80004005): The wait operation timed out] [SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not [...] read more
sql
sql-server
tsql
sql-server-2012
10votes
5answers

SqlException (0x80131904): Invalid object name 'dbo.Categories'

I am getting the exception above when I run an application. The application is using asp.net mvc 3 / C#. I made an mdf file and added it under App_Data folder in Visual Web Developer Express. I added connection strings to the web.config folder but when I run and browse [...] read more
c#
sql-server
asp.net-mvc
entity-framework
asp.net-mvc-3
6votes
2answers

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

Why can't I see a localdb database created by a UWP (Desktop Bridge App) in the SQL Server Object Explorer?

Does UWP support LocalDB? My investigations indicate there are some issues using localdb that I don't experience with SQL Server 2017 Development edition. I managed to convert a winforms EF-Code First, xaf application to run as a UWP app with the help of this blog I have Enterprise Authentication set. [...] read more
entity-framework-6
desktop-bridge
xaf
project-centennial
sql-server-2016-localdb
5votes
4answers

The UPDATE statement conflicted with the FOREIGN KEY constraint in EF Core

We have 3 model classes: * Host * TournamentBatch * TournamentBatchItem Host has many TournamentBatch. TournamentBatch has many TournamentBatchItem. In the TournamentBatch table will have FK Host. We did override for SaveChangesAsync in ApplicationDbContext to allow soft-delete as following: public override Task<int> SaveChangesAsync(bool acceptAllChangesOnSuccess, CancellationToken cancellationToken = default(CancellationToken)) { OnBeforeSaving(); [...] read more
c#
asp.net-core
entity-framework-core
asp.net-core-2.0
asp.net-core-2.1
5votes
5answers

SQL Server Agent - SSIS Package - Error 0x80131904 - Timeout expired

There's been a string of random occurrences of the following error in the SQL Server Agent scheduled jobs lately that I have been unable to find a solution to. The error occurs infrequently, but usually once a week for a daily scheduled job, but in any number of different jobs [...] read more
sql-server
ssis
sql-server-2012
sql-server-agent
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
2answers

NLog, ASP.NET Core and SQL - The server was not found or was not accessible

I've been trying to get an ASP.NET Core site working with NLog. It works fine until I try to write to a SQL Database. I've tried local databases and Azure databases - all with the same problem. I've even added the nlog table to a known database, one the site [...] read more
sql-server
asp.net-core
nlog
4votes
2answers

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

Invalid column name when published on azure

Hello I have a application published on azure. When I try to acces BookDetail page I get a InvalidColumn "Borrowed" error. The same thing happens on a UserDetail page with column PhoneNumber and Password. Here is the BookDetail getmethod public IQueryable<Book> GetBook([QueryString("BookID")] int? BookID) { var _db = new WebApplication1.Models.LibraryContext(); [...] read more
c#
sql
asp.net
linq
azure
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
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
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
ef-migrations
3votes
1answer

Timeout when passing large table-valued parameter

I am calling a SQL Server stored procedure using ADO.NET, and I have to pass a very large Table-Valued parameter. I get this timeout exception very often: System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): [...] read more
c#
sql-server
ado.net
timeout
table-valued-parameters
3votes
2answers

Cannot import data to SQL Server database with C#

I have exported data from SQL Server express and I try to import them into another database. I want to use it as "Repair Table" in which I will add more tables with data and I always get an error and I can't understand why. The error is > Message [...] read more
c#
sql-server
2votes
0answers

.NET Core API can't connect to database via docker-compose

I'm developing a .NET core web API with a MSSQL Server database. I tried to containerize this into a Docker container and use Docker Compose to spin up this service. But my API cannot connect to the database. The following error occurs: > Application startup exception: System.Data.SqlClient.SqlException (0x80131904): A network-related [...] read more
sql-server
docker
.net-core
docker-compose
containers
2votes
1answer

How to restore SQL localDB programmatically

I'm trying to create backup and restore functionality to my Windows form application. So, I've tried to do a database restore. My code is like this: string cbdfilename = "c:\\Users\\Public\\Public Document"; SqlConnection.ClearAllPools(); SqlConnection con = new SqlConnection("Data Source=(LocalDB)\\v11.0;AttachDbFilename=|DataDirectory|\\BbCon.mdf;Integrated Security=True;Connect Timeout=30;"); string sql; sql = "Use master;Alter Database BbCon Set Single_User [...] read more
c#
sql-server
restore
localdb
2votes
0answers

AutoMapper + nullable foreign key + Entity Framework Core

Status Update (12/19/18) The problem is that when Map<Product>(cmd) executes, AutoMapper maps a new Color type (with null values) to Product. -------------------------------------------------------------------------------- Question: Could this be a bug when AutoMapper tries to “flatten’ the ColorSystemName member? -------------------------------------------------------------------------------- ProductCmd.cs public class ProductCmd { public virtual int? ColorId { get; set; } [...] read more
c#
entity-framework-core
automapper
2votes
1answer

ASP.NET Core MacOS Connection string

I have issues establishing connection to my mysql server database on MacOS using Entity Framework Core for ASP.NET Core 2.0 project. I am following this tutorial: https://blog.jetbrains.com/dotnet/2017/08/09/running-entity-framework-core-commands-rider/ My database is started as a default mysql server service on my MacBook running on localhost:3306 and has a User and Password for [...] read more
c#
mysql
entity-framework
asp.net-core
entity-framework-core
2votes
0answers

ASP.NET Session State with SQL Server In-Memory OLTP and Session isolation set to snapshot

We deployed a new build on Framework v 4.7.2. We also deployed the async Asp.Net session state module and in memory OLTP provider as documented here Our testing environment was fine, and the canary server tested fine. We then rolled the build out to the other servers in the farm, [...] read more
c#
asp.net-mvc
session-state
sql-server-2017
memory-optimized-tables
2votes
0answers

EF Core migration fails, table already created

Here is my DbContext class public class BlogContext : DbContext { public BlogContext (DbContextOptions<BlogContext> options) : base(options) { } public DbSet<User> Users { get; set; } public DbSet<Post> Posts { get; set; } public DbSet<Comment> Comments { get; set; } } And here are the commands i enter into the [...] read more
c#
ef-core-2.1
1vote
1answer

Dynamic CRM 2011 Import Organization from different locale fails on SQLException

UPDATE : Issue solved, see answer below. I'm struggling with a Dynamic 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 [...] read more
microsoft-dynamics-crm
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
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

How to fix SQL Exception happening only in android?

I'm using xamarin forms to develop a cross-platform app. As part of my app, I have a login page where the user enters his credentials and gets authenticated. I'm using entity framework core and I'm connecting to a SQL server which is hosted on Azures cloud. The code works and [...] read more
c#
xamarin.forms
entity-framework-core
azure-sql-database
1vote
0answers

C# Sqltimeout command don't know program side or sql server side

I have a c# program that connects to sql server and get data. This part of program that connects to sql has lots of classes and inheritance that is not written by me and I've never managed to get sqltimeout exceptions from that, which connects to sql server and receives [...] read more
c#
sql-server
timeout
timeoutexception
1vote
1answer

Conversion From nvarchar value to to data type int failed?

I have this Table Type CREATE TYPE ItemTableType AS TABLE ( BrandId INT, BranchId INT, InventoryCategoryId INT, Attributes nvarchar(Max), Price Decimal(18,2), [Description] nvarchar(Max) ); I create a datatable in my C# code like this var dt = new DataTable(); dt.Columns.Add("BrandId"); dt.Columns.Add("BranchId"); dt.Columns.Add("attributes"); dt.Columns.Add("InventoryCategoryId"); dt.Columns.Add("Price"); dt.Columns.Add("Description"); foreach (var item in inventoryItems) [...] read more
c#
sql
json
sql-server
datatable
1vote
0answers

Error removing the IUser in EpiServer - SqlException: Execution Timeout

I have used, CommunitySystem.CurrentContext.DefaultSecurity.RemoveUser(IUser user); To remove user. However, this was working fine. But suddenly it has given an error. And it keeps happening forever. The exception throws from the RemoveUser(IUser user). The exception details are here as below, System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to [...] read more
episerver
1vote
0answers

Error when running Data Profiling Task with Azure SQL Server data

When running a Data Profiling Task in SSIS with data from an Azure SQL Server, I receive the following error message: > System.Data.SqlClient.SqlException (0x80131904): USE statement is not supported to switch between databases. Use a new connection to connect to a different database. I am unsure how to work with [...] read more
azure
ssis
azure-sql-database
azure-sql-server
data-profiling
1vote
0answers

EF6 Update-Database is attempting to create a column that would duplicate an existing computed column

I have some computed columns in a SQL database that're giving EF6 a good bit of trouble. I'm using this technique. For some reason, the PM command Update-Database insists on trying to add a column to a table that already exists as a computed column. I only discovered this by [...] read more
sql-server
entity-framework
ef-code-first
1vote
1answer

NLog adding a database schema name

I am unsure if its possible to add a database schema to NLog. I have tried this method: <?xml version="1.0" encoding="utf-8" ?> <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" autoReload="true" internalLogLevel="Info" internalLogFile="C:\temp\internallog.txt"> <targets> <target name="logfile" xsi:type="File" fileName="C:\temp/${shortdate}_logfile.txt" layout="${longdate} ${level:uppercase=true} ${message}"/> <target xsi:type="Database" name="database" connectionString="Server=.\SQLEXPRESS;Database=AppDB;Trusted_Connection=True;MultipleActiveResultSets=true;User Id=AppDBUser;Password=PSSWRD!" commandType="StoredProcedure" commandText="[AppDB].[ASTONE.EventLogs]"> <parameter name="@message" layout="${message}" /> <parameter name="@level" layout="${level}" [...] read more
asp.net
logging
asp.net-core
nlog
1vote
2answers

Database login failed for user

I am aware that this question repeats from time to time but I tried almost every response here and I still encounter a problem with code below that tries to connect to my MS SQL Server 2014: SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(); builder.DataSource = "(LocalDB)\\v11.0"; builder.UserID = "LOGIN"; builder.Password = [...] read more
c#
sql-server
database
1vote
1answer

C# Edit row in SQL

I got some issues with my code. This is my method in my Database class public void editproduct(string a, int b, int c) { conn.Open(); SqlCommand command = new SqlCommand("UPDATE Productdescription SET pdescription = '" + a + "',Price = " + b + " WHERE pid = " + [...] read more
c#
sql
.net
sql-server
ado.net
1vote
1answer

VB.NET SQL Server: Must declare scalar variable

I am trying to make a query that deletes the user from my database. But when i confirm to delete the user it gives me an error: > System.Data.SqlClient.SqlException (0x80131904): Must declare the scalar variable "@Username". Imports System.Data.SqlClient Public Class DeleteForm Private Sub btnDelete_Click(sender As Object, e As EventArgs) Handles [...] read more
sql-server
vb.net
1vote
1answer

Angular 2+ and ASP.NET Core Web API - How to publish on Heroku?

I have applications: 1. Client-side which is Angular 2+/ASP.NET Core project 2. Server-side ASP.NET Core Web Api with MS SQL database (Entity Framework Core) This apps have configured CORS. How can I publish both of this apps on Heroku? I started with the server-side using this tutorial https://blog.devcenter.co/deploy-asp-net-core-2-0-apps-on-heroku-eea8efd918b6 But after [...] read more
asp.net
sql-server
angular
heroku
deployment
1vote
1answer

Copying project does not retain Entity Framework connection

I'm moving my project from one machine to another. I simply zipped the project folder and moved it to my new computer. My project is an asp.net mvc application with Entity Framework. I have my connection string in my web.config file. When I run my application on my new machine, [...] read more
c#
asp.net-mvc
entity-framework
entity-framework-6
entity-framework-core
0votes
0answers

Cannot Connect From Amazon aws t2.micro windows 2012 instance to Amazon RDS SQL Express 2014

I cannot connect to RDS SQL Server 2014 Express instance from EC2 Windows 2012 server instance. 1. I cannot connect through UDL file, and also not through my asp.net mvc web application. Windows EC2 Instnace ID: i-0fe6390a77605e7f2 Availaibility Zone: us-east-2c RDS SQL Server Instnace ID: tandt-201901-2 RDS SQL Server Zone: [...] read more
windows-server-2012-r2
amazon-ec2
amazon-rds
sql-server-2014
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
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
0answers

SQL server named instance connection

On several occasions I have observed a intermittent connection failure to SQL server (2012) resulting in the following stacktrace 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 was not accessible. Verify that the instance name is correct [...] read more
sql-server
sql-server-2012
0votes
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
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
0answers

How to adjust the Connection Retry Algorithm for TCP - SQL 2012 Mirroring Principle Timeout

This is our situation, we have SQL Server 2012 in a mirroring state. We get the following errors throughout the day. * System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding-System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior [...] read more
tcp
timeout
sql-server-2012
mirroring
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
0answers

EF core update after migration fails due to nullable type change to enum

I'm using EF core 2.2.1 and I'm stuck with the following error when I update to the latest migration: > System.Data.SqlClient.SqlException (0x80131904): Cannot insert the value NULL into column 'CountryCode', table 'context.dbo.User'; column does not allow nulls. UPDATE fails. The statement has been terminated. The message is clear and due [...] read more
c#
asp.net-core
.net-core
entity-framework-core
ef-core-2.2
0votes
0answers

AlwaysEncrypted Insert fails intermittently

We have been using the AlwaysEncrypted feature of Microsoft SQL for over a year now. Until now, it has worked flawlessly. Previously, we had only a very few columns encrypted (4). A week ago, we implemented encryption on another 11 columns, so we still make very light use of it. [...] read more
c#
sql-server
always-encrypted
0votes
2answers

Can't reach docker-hosted SQL server from web app docker on same host

On the same virutal machine (remote, ubuntu), I have * An SQL Server running in a Docker * An .NET Core 2.2 (IdentityServer) application running in a docker * An instance of jwilder.nginx-proxy serving as a reverse-proxy for every web application on the machine * A multitude of other .NET [...] read more
sql-server
docker
asp.net-core
0votes
0answers

Intermittent network-related or instance-specific error occurred while establishing a connection to SQL Server

I am running unit tests in debug on my Win 10 development machine. I access a SQL Server 2017 database on Linux across an "on prem" network. I can access the database using Management Studio. Sometimes I get the following error. I can work around the error by rebuilding the [...] read more
sql-server
.net-core
entity-framework-core
0votes
0answers

Invalid object name 'DAppRoles'

In my EF Core 2.2 app, I changed DBSet DRoles to DairyRoles in the AppDBContextlike this: public DBSet<DairyRole> DairyRoles { get; set; } and then executed context.Database.EnsureCreated(); Error System.Data.SqlClient.SqlException (0x80131904): Invalid object name 'DairyRoles'. I thought context.Database.EnsureCreated(); handles migration. Please help. read more
entity-framework
ef-core-2.2
0votes
1answer

abp entity not exist: AbpEntityChangeSets

Using ABP Core I always stayed up to date with the newest NUGET packages. What I forgot was to create migrations. I just moved to ABP4.2.0 when i realized that my last EF snapshot was from ABP3.5.0. I created a new migration completing with this warning: > An operation was [...] read more
c#
asp.net-core
entity-framework-core
aspnetboilerplate
0votes
0answers

Connection Timeout issue in Entity Framework Core

I have a multi-threading application that needs to insert bulk of records in the same table from different places. After continuously running for 2 hours, my application runs into a connection time out issue. Stack Trace > System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the [...] read more
c#
entity-framework-core
0votes
0answers

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

Invalid Object name in entity framework MVC [TPC Approach]

I have implemented the DbContext in my project. I used the inheritance using the TPC Approach of entity framework. When I run the code to fetch the database record it throw an exception. [Added the class structure with exception message] When I use the Entity framework to get the user [...] read more
c#
model-view-controller
entity-framework-6
0votes
0answers

Application does not connect to the database after deployment on Azure

When publishing MVC app on Azure, the connection string is picked automatically but I fail to understand how the deployed app connects to the database using this connection. > There's server error: SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was [...] read more
asp.net-mvc
azure
azure-sql-server
0votes
1answer

REST API - Calling Custom PXAction from Endpoint

I want to call a PXAction from the endpoint, pass it a record (or set of records if possible), and then have it pass me back the records updated with some information. I have the following Action in my graph (graph is really only to allow this single action to [...] read more
acumatica
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

Query of on-premises SQL Server from Azure web app (over Azure S2S VPN) fails

Our infrastructure team has worked to configure a site-to-site Azure VPN connection between our Azure subscription and our on-prem firewall, essentially following these steps. To test this, we've created a simple Azure web app that makes a query against a SQL Server that is located on-prem behind the firewall. This [...] read more
sql-server
azure
azure-web-sites
azure-virtual-network
azure-vpn
0votes
2answers

EF Core 3.0 Manually setting connection string

I'm developing a console app with .NET Core & EF Core (both are v3.0); and I need to start my DbContext using an string generated from another class. DbContext file public Arta_LuniaDBContext() { } public Arta_LuniaDBContext(DbContextOptions<Arta_LuniaDBContext> options) : base(options) { } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.UseSqlServer(DataServices.ConnectionString); } DataServices [...] read more
c#
sql-server
entity-framework
.net-core
0votes
1answer

Connection Timeout Expired When there are many requests simultaneously

I have a .Net Application(REST API) which accesses SQL Server Database. Sometimes When there are many API requests at the same time, I get Connection Timeout exception due to which all the request fails. This is not always the case and happens only when there are many requests hitting the [...] read more
asp.net
.net
sql-server
asp.net-mvc
asp.net-apicontroller
0votes
0answers

Unable to ExecuteScalar() because of authentication error

I am following a Microsoft tutorial for setting up forms-based authentication, and getting a failure. Here is the tutorial: https://support.microsoft.com/en-sg/help/301240/how-to-implement-forms-based-authentication-in-your-asp-net-applicatio This line is failing: // Execute command and fetch pwd field into lookupPassword string. lookupPassword = (string) cmd.ExecuteScalar(); I am getting this error: System.Data.SqlClient.SqlException (0x80131904): Login failed for user 'HOME\TSLAB1$'. [...] read more
asp.net
authentication
iis
0votes
1answer

NLog getting current user causes error to appear

This is my target <target xsi:type="Database" name="database" connectionString="${var:connectionString}" commandText="INSERT INTO [AppOne].[EventLogs](Id, Message, Level, Logger, Action,Identity)VALUES(NewID(), @Message, @Level, @Logger, @Action,@Identity)"> <parameter name="@Message" layout="${message}" /> <parameter name="@Level" layout="${level}" /> <parameter name="@Logger" layout="${logger}" /> <parameter name="@Action" layout="${aspnet-mvc-action}"/> <parameter name="@Identity" layout="${aspnet-user-identity}"/> I have also placed this line in my Startup.cs services.AddSingleton<Microsoft.AspNetCore.Http.IHttpContextAccessor, HttpContextAccessor>(); However, when [...] read more
asp.net
logging
asp.net-core
nlog
0votes
1answer

CREATE DATABASE permission denied in database 'master' accessing as SA

I created a small application for test purposes. The problem starts when I try to deploy the app to an Azure VM. When accessing the published app, I get an error > CREATE DATABASE permission denied in database 'master' The strange thing is that it works fine when I access [...] read more
sql-server-express
0votes
1answer

Disable automatic migrations in entity framework

I have my Configuration class constructor like this: public Configuration() => AutomaticMigrationsEnabled = false; And I have even updated my DbContent to this: public DatabaseContext() : base("DefaultConnection") { Database.CommandTimeout = 900; Database.Log = s => Debug.WriteLine(s); Configuration.LazyLoadingEnabled = false; Database.SetInitializer(new CreateDatabaseIfNotExists<DatabaseContext>()); } But when I try to run update-database for [...] read more
c#
entity-framework
0votes
1answer

View currently published page in Sharepoint

I am making edits to a client's Sharepoint site. I checked out the page, made all the changes required, checked it back in, and am waiting on their go-ahead to publish. I want to double-check that certain elements are the same as they were before I started editing. Generally I [...] read more
sharepoint-2013
0votes
0answers

how to target sql server 2008 with EF Core

Building a razor pages application usign ef core 2.1.1. Development DB server localDB, target SQL server SQL 2008 r2. I get the following error on the target server: > System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near 'OFFSET'. Invalid usage of the option NEXT in the FETCH statement. I suppose the generated SQL [...] read more
ef-core-2.1
0votes
1answer

Visual Studio web deploy of ASP MVC app

I'm trying to web deploy a code first ASP MVC app. The shared host has web deploy enabled, and the app uploads and gets published. However, it can't create the database. > [Win32Exception (0x80004005): The system cannot find the file specified] [SqlException (0x80131904): A network-related or instance-specific error occurred while [...] read more
asp.net
asp.net-mvc
webdeploy
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

2SXC Upgrade from 9.2.0 to 9.33.0 results in error

I have a DNN 7.4.2 instance with 2SXC 9.2.0 installed. I went to Host > Extensions and went to install 2SXC 9.33.00 and I got the following error. StartJob Starting Installation Info Starting Installation - 2SexyContent Info Starting Installation - Script Info Begin Sql execution Info Creating backup of previous [...] read more
dotnetnuke
2sxc
0votes
1answer

Unable to Login & Register in ASP.NET MVC Application but Able to access other Data

Unable to connect to SQL & login in ASP.NET MVC web application. But I am able to connect & retrieve all other data. Only login & register are not working. I don't know what's wrong. Login: > Source Error: An unhandled exception was generated during the execution of the current [...] read more
c#
asp.net
sql-server
asp.net-mvc
entity-framework-6
0votes
2answers

SqlParameter "disappears" when assigned a value of null?

I stumbled across the following issue recently: Assigning a null to the Value property of an SqlParameter appears to cause the parameter to be omitted from the query rather than passing NULL. This results in a potentially misleading error message when the Stored Procedure has no default value for the [...] read more
.net
sql-server
default-value
sqlparameters
0votes
1answer

SqlDependency.Start method fails after deployment

After implementing caching for my ASP MVC 5 app, and using SqlDependency and service broker, everything works fine on the local database. I get notifications when a specific change occurs in the database. However, after deploying the application to production machine, call to SqlDependency.Start(string connectionString) fails by throwing an exception: [...] read more
sql-server
asp.net-mvc
sqldependency
0votes
2answers

c# System.Data.SqlClient.SqlException (0x80131904)

Using c# .net 4.6.1 I have a program where I'm trying to query a MS SQL Server 2016 database. I have 2 remote servers, Server A and Server B. My c# program runs on Server A with no problems. When I run the program on Server B I get the [...] read more
c#
sql-server
database-connection
0votes
1answer

NOT keyword error in Db update from SQL migration from Asp.Net Core 2.1 web app

I am migrating a code first domain (Initial creation) in an Asp.Net Core 2.1 web application. The add-migration command created the following code (non erroring parts removed for brevity) migrationBuilder.CreateIndex( name: "RoleNameIndex", schema: "BatlCtx", table: "AspNetRoles", column: "NormalizedName", unique: true, filter: "[NormalizedName] IS **NOT** NULL"); migrationBuilder.CreateIndex( name: "UserNameIndex", schema: "BatlCtx", [...] read more
c#
asp.net-identity
sql-server-2016
asp.net-core-2.1
0votes
1answer

Azure SQL Timeout after query inactivity

I'm experiencing frequent timeouts on my managed Azure SQL Instance. When no query activity have occurred for some time, the first query, which is expected to return between 500-2000 rows, will use all the available DTUs in my pricing tier (S2 50 DTU plan) and always result in the following [...] read more
azure
azure-sql-database
azure-sql-managed-instance
0votes
1answer

SQL Query works in SSMS but not in C#: SELECT denied

To begin with: It is not a particular statement that does not work. SELECT * FROM [TABLE]; does not work either. When I run it in SSMS as user A it works perfectly fine. When I use it in C# like this: string sqlCommand = "SELECT * FROM [TABLE];" using [...] read more
c#
sql-server
ssms
sqldatareader
0votes
0answers

Kendo Grid Server Side filtering is not working for DateTime columns

I am using a DateTime column with filterable options enabled. When I apply a filter on this column, the request.Filters has a valid DateTime but it is applying an incompatible format when it calls SQL Server. Here is my code: public async Task<JsonResult> OnGetDataAsync([DataSourceRequest]DataSourceRequest request, CustomFilterModel customFilters) { IQueryable<DAL.Product> products [...] read more
asp.net-core
kendo-grid
entity-framework-core
kendo-asp.net-mvc
razor-pages
0votes
5answers

Selecting from a SQL table but there is an exception thrown

I get this error when I want to read the table: > System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near ','. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, [...] read more
c#
sql-server
telegram
sqlcommand
sqltransaction
0votes
1answer

SQL agent job failed with an error 0x80131904

I have one SQL agent job that executing the SSIS package. When the job is running through schedule then it is giving an error: > Failed to execute IS server package because of error 0x80131904. Server: XXXXX Package path: "XXXX" Environment reference Id: 2. Description: The operation failed because the [...] read more
sql-server
sql-server-2008
sql-server-2008-r2
sql-server-2016
sql-agent-job
0votes
1answer

how to solve the Inedo Hub Proget installation error?

i am trying to install proget on my 2012 server, i am getting these error, this might be due to error in configuration Please let me know the integration url and feed url.. enter image description here [https://i.stack.imgur.com/QMHnF.jpg]enter image description here [https://i.stack.imgur.com/dNUBn.jpg] Product: ProGet Version: 5.1.15 System.Data.SqlClient.SqlException (0x80131904): Invalid object [...] read more
proget
0votes
1answer

Scheduled Task SQL timeout, but not when running manually

I have a problem where I have to run a C# Console application via a scheduled task. The scheduled task calls a Powershell script which sets some variables (like a connection string) and calls a C# console application which connects to a database with those arguments. The problem is that [...] read more
sql
powershell
scheduled-tasks
0votes
1answer

VB: Login failed for 'user' when reloading SqlDataSource

This is really weird, I can't get a grip around it. I have a SqlDataSource linked with a datagrid. All works well, that is until I try to rebind the SqlDataSource. Then I get the following error: > Login failed for user 'testuser'. Description: An unhandled exception occurred during the [...] read more
asp.net
vb.net
datagrid
sqldatasource
0votes
0answers

Why goes "GO" work inside a Migration, but not with ExecuteSqlCommand?

I understand that GO is not actual valid SQL and instead a keyword used by SSMS to separate scripts into batches. What I don't understand is why it still works in Migrations. I have several scripts with GO in them, and run them as part of EF Core Migrations, which [...] read more
c#
entity-framework-core
entity-framework-core-migrations
0votes
2answers

Error when inserting record to SQL Server database from ASP .Net Core 2.1 Web API using EF Core 2.1

I've created a new ASP .Net Core 2.1 Web API. It uses EF Core, code first, to read and write to a SQL Server database. So I've used migrations to generate/scaffolding the database. On the [HTTPPOST] action method in the controller, when it adds a new record to the DbContext [...] read more
sql-server
asp.net-core-2.1
ef-core-2.1
asp.net-core-webapi-2.1
0votes
2answers

.NET Core process crashing due to an SQL connection pool exception

I recently migrated a .NET Framework 4.6.1 application to .NET Core 2.1 and the process is crashing when the SQL AZure database becames unavailable. The process runs on Windows as a Service. The problem itself is not the exception (it is an expected condition of SQL Azure) but the fact [...] read more
c#
.net
.net-core
azure-sql-database
0votes
0answers

SqlException: Cannot attach the file xyz as database xyz

I'm unable to let EF6 create a new DB instance (i deleted the old one before). This is my connection string: "Server=(LocalDb)\PasV4;AttachDbFilename='C:\Users\ME\AppData\Local\Temp\DBNAME.mdf';Integrated Security=true;Database=DBNAME" Whenever I run Database.CreateIfNotExists();this exception is thrown: System.Data.SqlClient.SqlException HResult=0x80131904 Message=Cannot attach the file 'C:\Users\sebdau\AppData\Local\Temp\vma-devTest' as database 'vma-devTest'. Source=.Net SqlClient Data Provider StackTrace: at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, [...] read more
entity-framework-6
localdb
0votes
0answers

Unable to create SqlConnction with "Integraded Security=SSPI" connection string on Mono 5.16.0.179 (Linux)

I'm trying to port my application to Mono and I'm currently testing connecting to a Microsoft SQL Server 2008 to retrieve and insert test data. The server requires Windows Authentication but when providing Integrated Security in the connection string, a Specific method is not supported exception is thrown. When removing [...] read more
c#
.net
linux
mono
windows-authentication
0votes
0answers

C# Mars: Physical connection is not usable

I am creating a web app in which I am using multipleactiveresultSets, Sometimes I am getting the error like > System.Data.SqlClient.SqlException occurred HResult=0x80131904 Message=Failed to establish a MARS session in preparation to send the request to the server. (provider: SMux Provider, error: 19 - Physical connection is not usable) Source=.Net [...] read more
c#
sql
asp.net
mars
0votes
0answers

DELETE C# SqlCommand: Subquery returned more than 1 value

I have an error doing either a DELETE or INSERT using a C# SqlCommand; database is SQL server. The SQL statement is DELETE FROM [table_name] WHERE id = 'some_id'; which is pretty simple. id is a column name with datatype varchar(15) that can be NULL; some_id has 15 characters. First, [...] read more
c#
sql
sql-server-2016
sqlcommand
0votes
2answers

The collection argument 'foreignKeyPropertyNames' must contain at least one element

I have two models with certain properties: public class Issue { public int Id { get; set; } } public class Action { public int Id { get; set; } } This was the last working code. Then as I forgot to add Issue as a foreign key property to [...] read more
sql-server
asp.net-core
.net-core
entity-framework-core
ef-core-2.0
0votes
0answers

Postgres access from custom dll with EF6

I have dll with data context using rmclibrary.Model; using System.Data.Entity; namespace rmclibrary { public class RmcContext : DbContext { public RmcContext() : base("RmcContext") { } public DbSet<Brand> Brands { get; set; } // ...and etc } } In the Brand class I have Check method public class Brand { [Key] [...] read more
c#
entity-framework
entity-framework-6
0votes
1answer

LINQ2SQL Expression - Conversion failed when converting date

I have this Linq expression var searchDate = DateTime.ParseExact("17.12.2018", "dd.MM.yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None); result = result.Where(DatePredicate("LaunchWeekStartDate", searchDate, 3)); and I call this expression public static Expression<Func<General, bool>> DatePredicate(string columnName, DateTime searchValue, int? operatorId) { var type = typeof(General); var x = Expression.Parameter(type, "x"); var member = Expression.Property(x, columnName); Expression expression; var [...] read more
c#
lambda
linq-to-sql
0votes
0answers

SqlException: Conversion failed when converting the ****** value '******' to data type ******

I've got an ASP.NET MVC web app, running in Azure, against an Azure SQL database, using EF 6. Yesterday I discovered an error when opening a page that uses a stored procedure to get some data: > System.Data.SqlClient.SqlException (0x80131904): Conversion failed when converting the ****** value '******' to data type [...] read more
sql-server
azure-sql-database
azure-web-sites
0votes
0answers

System.Data.SqlClient.SqlException (0x80131904) when executing update-database in the package manager

When I am doing an update-database in the package manager in visual studio I am getting the error. Can someone help me ? > 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 was not accessible. Verify that [...] read more
c#
sql-server
visual-studio
0votes
2answers

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

Problem connecting an ASP.NET Core 2.1 API inside a linux docker container to a SQL Server database on another machine

I built a ASP.NET Core 2.1 Web API using Entity Framework. Now I need to deploy that WebAPI to one of our servers. The api works perfectly in Visual Studio, with access to the database hosted on another server. The database server has a static IP that is only accessible [...] read more
docker
asp.net-core
sql-server-2008-r2
windows-server-2008-r2
-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

TF400129: Error from readiness check: Verifying that the Model Link does not exist

TF400129: Error from readiness check: Verifying that the Model Link does not exist I got this error updating from tfs2018.2 to tfs2018.3 . How to fix it? Logs: [Error @20:34:16.503] System.Data.SqlClient.SqlException (0x80131904): Nome de objeto 'tbl_ToolType' inválido. at Microsoft.TeamFoundation.Framework.Server.TeamFoundationSqlResourceComponent.MapException(SqlException ex, QueryExecutionState queryState) at Microsoft.TeamFoundation.Framework.Server.TeamFoundationSqlResourceComponent.HandleException(Exception exception) at Microsoft.TeamFoundation.Framework.Server.TeamFoundationSqlResourceComponent.ExecuteCommand(ExecuteType executeType, CommandBehavior behavior, [...] read more
tfs
tfs2018
-1votes
0answers

Can't put single quotes around parameter with string.format in C#

C# - I have a sql string that I am using with string.format. I need to put single quotes around the parameter {1} which returns 'OUTFALL 002'. SO the string would need to look like this: and smp.sys_loc_code = 'OUTFALL 002' I am trying this and smp.sys_loc_code = \'{1}\' but [...] read more
c#
string
string.format
-1votes
1answer

C# - How to send Insert with @Parameters to Database Connection Class

Having a bit of an issue getting my insert to work properly. When I run the insert all within the same method, it works flawlessly... however when I try to send the Insert statement to my new Connection class (which I will have handle all database requests), I am getting [...] read more
c#
sql
sql-server
asp.net-core
.net-core
-1votes
2answers

SQL Server contains predicate not working with multiple search terms

I have a c# program that searches a table by the user's input. The keywords are split by a space and saved into an array. Then the switch statement will select the correct case based on having only entered one word, or two words. My switch statement only fills my [...] read more
c#
sql-server
full-text-search
-1votes
2answers

C# connection to SQL Server using multiple comboboxes to data in multiple tables

I have the following C# code that I need to pass the information from a SQL Server database into a combobox and listbox. I can get the customer information to work but as soon as I add the products information (in bold), I get an error. I am not sure [...] read more
c#
sql-server
-1votes
1answer

INSERT statement conflicted

This error is popular here but I have a different case here. I have the tables linked. I have data in the Department table, so the Foreign Key exists. Here, is the error: > The INSERT statement conflicted with the FOREIGN KEY constraint "FK_dbo.AspNetUsers_dbo.Department_Department_Id". The conflict occurred in database "aspnet-hr_pcms-20181109102923", [...] read more
c#
sql
asp.net-mvc
entity-framework-6
-1votes
1answer

Update ALL changes in a table

Tableadapter update configuration for VS2017 Dear members, Sorry, I have to harass you again with a VB.net SQL problem in VS2017. I searched the internet for many days now, but did not find a solution for my problem. All the examples are or C and outdated. The situation is as [...] read more
vb.net
-1votes
1answer

SQL Server Data Rows exception incorrect syntax

I am working on a function and getting an error that keeps pointing in the area where the DataTable object is getting declared but it is only giving the following error (see below). Can someone tell me what I am missing? Code: SqlConnection myConnection = ConfigManager.SqlConnection; /// <summary> /// Load [...] read more
c#
sql-server
webforms
-2votes
0answers

How to fix "Deadlock" issue?

Here I am using Enterprise library and using "Transaction Scope" for rollback data if any issue happen during my execution. Now what is happening, when two processes (same console application) are running at same time. Deadlock issue is happening, I am not getting where is the issue. Below is the [...] read more
c#
sql-server
console-application
deadlock
-4votes
1answer

I am getting an error whenever I am saving the data to the SQL Server database using C#

I am working with my personal project which is a personal expenses system. I am trying to save data to SQL Server, but I am always getting an error: > "0x80131904" an attempt to attach an auto name database. A database with the same name exists. or specified file cannot [...] read more
c#
sql

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