Linq with Count and Group By
I'm porting legacy code that utilized stored procedures to Entity Framework Core. The stored procedure looks like:SELECT Distinct DiagnosisCode, DiagnosisCodeDescription, Count(*) as Count from...
View ArticleHow to concatenate string on a server side in Entity Framework core Linq query
I am using the newest EF core (3.1.8).My goal is to concatenate a subquery table that returns string into one single string, I don't want SQL Server to return cloned row data by subquery rows.I've...
View ArticleLinq group by question
Hi,Can I group by this?9501 England 1023 1023 London 9501 Englang 1090 1090 Manchester 9501 England 1094 1094 Liverpool 9501 England 1108 1108 Birmingham 9502 US 1181 1181 Boston 9502 US 1247 1247 New...
View ArticleQuestion about the Silly actions with Entity Framework
For the life of me I have no Idea why Entity Framework makes using SQL views sooooooooooooo difficult.My errorSeverity Code Description Project File Line Suppression State Warning Error 6013: The...
View ArticleStored procedure the second time that is called does not update the data...
Hi,I have a service class that use a entity framwork for call a strored procedure with "FromSqlRaw" method.All work fine a first time, but in second time doesn't work the chipsReport array it is not...
View ArticleC# sql duplicate code
can some please let me how to fix my code?SqlConnection con = new SqlConnection("constring"); SqlCommand cmd = new SqlCommand("SELECT * FROM Ware WHERE Green=@Green,Red=@Red,Active=@Active",...
View ArticleCombining 4 datasets in one datatable
Hi,I have 4 datasets - ds1, ds2, ds3 and ds4. They all return the same data structure.I want to combine all the datasets in a single data table and remove duplicate id number's from the response.Any...
View ArticleEntity Framework Core no mapping to a relational type can be found for the...
Good day, I am having an issue using the .FromSqlRaw as it it returning an Unhandled Exception: InvalidOperationException: No mapping to a relation type can be found for the CLR type ;object[]'....
View ArticleNhibernate Executiontimeout * No Lock
The below Nhibernate call is failing with "Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding."}...
View ArticleConditional where clause inline query if parameter is empty
In my application i am writing inline query to retrieve data from data base. not using stored procedure. One of my search functionality i am passing two parameter Firstname and lastname , If user not...
View ArticleEntityFramework core - It fails to load all related entities
Hi I need to load all my related entity with updated data but when a call my method this does not happen.My application load al data only if I restart it.Why?This my code private readonly ScaDbContext...
View ArticleHow to check which properties have been modified in a LINQ Object and save in...
Hi, I have an ASP.NET Webforms system using LINQ to Entity and I want to save in a database all the data that the user has modified. Does anyone tell me if there is a better way or do I have to...
View ArticleWrite Stored procedure SQL to insert data
<div>I have this table. I need to write a stored procedure to insert data into this table?| Field | Type | Null | Key | Default | Extra...
View Articleunbale to add ado.net data entity model vs 2015
i m working in vs 2015 and .net framework 4.5.1 when i add item(on project) and then ADO.Net Data Entity Model it gives below error ,An error occurred loading the entity data model tools package....
View ArticleConnect ASPNET Core web application to a Sql Server database through a SOCKS...
I have an ASPNET .Core application running on a pod in Kubernetes in AKS. The pod's network is an Azure's private network that is linked to my company's on-premise network via VPN. The web application...
View ArticleError in app.config
i m facing below exception in console applicationAn unhandled exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dllAdditional information: Could not load file or assembly...
View ArticleASP.NET newbie - should I learn ADO.NET or EF?
Hi All,My backgroundI am very familiar with SQL Server, stored procedures, indexing, queries etc.Now learning ASP.NET for the first time (learning ASP.NET Core with C#) Just learnt ADO.NET and...
View ArticleEF Core and SQL Functions
Hello,I'm trying to update a SQL FUNCTION in my database via EF Core migration. IF NOT EXISTS(SELECT * FROM [dbo].[_EFMigrationsHistory] WHERE [MigrationId] =...
View ArticleJson String to List
Hi,I am using MVC5, C#,. Net v4.7.2 & Entity Framework v6.I am using Stored Procedure in Entity Framework and it's returning JSON string as output. I want to convert this output as...
View ArticleQuerying an entity with Linq with name based on a string
I have a MVC project with Entity Framework. I need to be able to build a Linq query based on the name of the enitity which must be dynamic and can therefore change.The name of the entity is retrieved...
View Article