This is my table structure. I want to use SUM for Ingredients.Recipe_Ingredient_Gr and Ingredients.Recipe_Ingredient_Piece for each Recipe in selected order. My english is not enough to tell u exactly what i mean but i’ll try to tell u with example. in my program user will create stock data and after that they’ll create recipes for food and then they create
Tag: c#
c# ef core RemoveRange contraint violation
Hi I have a complex db with many tables and relations what we want to do is to copy all tables from a database to another but only taking rows starting from one table (salesorder) and going down following relations. So I avoided the .Include, and use IQueryable queries (one for each table) there is no problem with the insert
Finding Similar People’s Names from Database
I have a table in MySql with names in it. I am trying to, given an input name, find all similar names in the table. I’ve heard a lot about Levenshtien/Damerau–Levenshtein distance, but it doesn’t seem like it would work well for this, I’ll explain my reasoning later. To elaborate: User inputs a name that could have, say, five words
Update SQL table using C#
I’m trying to update EpisodeId no:117 in the Episode table and it executes successfully but when I check the table it is not updated. int episode Id = 117; Answer There are some issues with your SQL update statement.Look at following for reference to Update Statement in SQL LINK There is also an easier way to add the parameters using
Execute query and populate the same in datagrid Box
I have a winform app connected to access database as data source , but in access i was using this below SQL to generate a query table called trend: But i do not know how execute this & populate the same in datagrid box on form load event(dataset:CSCdataset) , please help me. Answer I guess you can find more information
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
LINQ for getting the 5 latest records for each distinct name
I have been trying to get the 5 most recent records from a database with distinct names from the “Name” Column. Meaning I want the 5 latest records for each of the unique names in the table. Here is a sample table: I would expect the latest 5 Bob records (out of the 6 ), the 3 Chris records, and
How many SQL Queries will be executed in the database through this EF
I have the following and want to know how many queries will be executed in the DB through this EF? private static dbContext dbc = new ProfileDBC(); private static IQueryable GetProfile(…
SQL GroupBy for Stored Procedure caused Error
I have a quick question that why my SQL Stored Procedure did not work properly. Can someone explain what is wrong with my Stored Procedure Query? Error: “Each GROUP BY expression must contain at least one column that is not an outer reference.” Answer It can never work the way you are trying it, because by definition, all column names
Why there is no GroupBy clause in internal SQL of Entity Framework linq query?
In documentation of Entity Framework: https://www.entityframeworktutorial.net/querying-entity-graph-in-entity-framework.aspx in section regarding GroupBy we can read that following code: executes internally following SQL: Why there is no GroupBy clause in SQL? If there is no GroupBy clause needed, can’t we just use simple Select with OrderBy and without Joins? Can anyone explain the above query? Answer The bottom line is: because SQL can’t