I created a Stored Procedure by Selecting values from 2 different tables. Now the problem I have is to execute and read the result data from my dotnetcore 3.1 code. I am not sure if the code I have written is correct. I am using IQueryable<AppUser> but, The SP contains a mix of AppUser and CourseMarks. So can I represent
Tag: .net-core
Selecting multiple columns for updating in Linq
I have a products table which contains thousands of products. I want to update only two columns (price, isAvailable) of this table. So is there is a way to select only those two columns from this table? This is the code that I am using. But I don’t want to select all columns. I have tried this But this is
SQL statement to Create Role fails on Postgres 12 using Dapper
I am running Postgres 12 on Windows and have a .Net Core app which uses Dapper as an ORM: The following query works fine: Now I’m trying to execute an sql statement that would create a role: This query fails with the following exception: Npgsql.PostgresException: ‘42601: syntax error at or near “$1″‘. What am I missing here? Answer The name
App.Config in a class library for data access from WPF and ASP.NET?
I’m trying to use SQL for the first time to store data in one of my projects, I’m using this tutorial as it makes the most sense to me, and to be honest I like the guys videos, and hate clicking on hundreds of bad videos before finding one I can learn from. Anyway I’m making an app where I
Entity Framework Core 3.0 .Include call taking 10x more time
I reviewed almost everything online but couldn’t get it work in a reasonable time. Entity Framework Core 3.0 .Include call is taking 10x more time than calling the individual tables separately and then mapping them in C# code. I have two tables product and productimages, where product productimages is a collection inside product. Now when I chain the call with
Best way to import XML into a database C# .NET Core
I’m working on a project that requires that I take data from an XML API that I don’t control and insert that data into a database (I control) for consumption by a different application (I control but …
How to make lookup field work in this case without defining the foreign key in the database?
The code is as follows (database first): C# code: UserTypeId is mapped, UserType is not. Any ideas how to make it work? Answer If we consider this as one to many relationship. Then Mapping using dataanotation will be like this. And to query
dotnet Entity Framework INSERT SELECT FROM other table
I am not an expert on databases and SQL. I am developing a dotnet core application using the Entity Framework to access a (postgresql) database. I have the following tables with the following columns: …