Skip to content

Tag: c#

How can i use sum ? with more then 2 key

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

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…

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

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 …

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

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, b…