All Questions
33,062
questions
0
votes
0
answers
45
views
SQL stored procedure to add dynamic rows group by page to material column
I need the Page row dynamically after each group of Material row. Some of Materials are grouped with a name in the Page column.
SQL query:
BEGIN
SET @SQL = '
WITH RowData AS (
...
0
votes
1
answer
52
views
Invalid object name "playerData"
in my database i have a table "playerData", but it can't be found, any idea why?
public Form1()
{
InitializeComponent();
}
public static string constr = @"Data Source=(LocalDB)\...
0
votes
1
answer
97
views
How do I return an object (with another object within) from a join table in SQL using C# and Dapper?
The problem I have, is that I am currently trying to get a list of objects with multi-mapping. I want get a list of Object A, that has Object B within, and both are saved separately in my database. ...
0
votes
0
answers
37
views
How to move photo path from database to image editor in c#?
On the Web Desktop App
I print the personnel information in my database into the datagrid. I can bring the required fields dynamically with focusedrowchange. As I bring the information, I want to ...
0
votes
2
answers
97
views
What should we do If we have Or condition in INNER JOIN with EF Linq?
I the code below I have a TSql query which has Or condition in its join. If I want to convert it to Linq in C# how can I rewrite it.
SELECT P.Id AS ProductId
FROM generalinv....
0
votes
0
answers
22
views
Duplicate subNodes Telerik c#
I am trying to obtain the subnodes of a route, I succeed but duplicates are generated as many times as turns are given to the foreach I think, how could I solve that problem?
private void ...
-2
votes
1
answer
86
views
AutoFill SQL Server from Datagridview c# [closed]
I have datagridview that connects to a database in SQL Server.
In the database, I have 2 columns NumCrimCase and Prosecutor
where I need to fill Prosecutor
NumCrimCase
Prosecutor
51-4462 км 23
уффуа
...
1
vote
0
answers
142
views
Converting SQL ROW_NUMBER to Linq produces wrong translation
I have the following SQL code and I want to convert it to a LINQ query in Entity Framework Core 8.
SELECT *
FROM(
SELECT ROW_NUMBER() OVER (PARTITION BY StaffId,[Location] ORDER BY [Timestamp] ...
0
votes
1
answer
92
views
EF Core: Navigation property not loading related entities despite Include
I'm encountering an issue with Entity Framework Core where a navigation property is not being populated, even though I'm using the Include method.
Relevant code:
FileRepository:
public IEnumerable<...
0
votes
2
answers
101
views
How to use a parameterized query with "GO" statements in .NET?
I am using ASP.NET as a backend to an application to update some data in a separate system's SQL Server.
I have a query that needs to insert many rows to a table. In each row, the values being ...
0
votes
1
answer
407
views
How to use raw SQL query in EF Core get the expected result set in .net core
I am trying to use raw SQL in .NET Core instead of normal EF Core approach.
Here is my query and what I am trying to do with it.
Entities used here are in a one-to-many relationship as one project can ...
-1
votes
1
answer
98
views
Getting a 'Conversion failed when converting date and/or time from character string' error [duplicate]
I have this code:
String strDateFormat = "yyyy-MM-dd";
DateTime startDateDate = string.IsNullOrEmpty(startDate) ? DateTime.Today.AddYears(-10) : DateTime.ParseExact(startDate, strDateFormat, ...
0
votes
0
answers
57
views
LINQ, first record in each group only if condition inside FirstOrDefault is met
I have a main table and a table that contains the translations of this table.
Table1
Id
Description
Table2
Table1_Id
Language
TranslatedValue
To get the grouped values I can left join the first ...
0
votes
1
answer
81
views
Find immediate parent based on condition SQL
I need to find the immediate parent id based on the below condition:
CustomerNum
ParentCustomerNum
IsPlatform
132
0
1
253
132
0
2041
253
0
2132
253
0
521
132
0
551
132
0
594
132
1
5642
5434
1
...
1
vote
1
answer
114
views
Deleting an EF Core entity ONLY if it's no longer referenced by parents
Say I have a table called Address which is referenced by Order, Person and Supplier.
Let's say I have a method UpdateOrderAddress that changes the order's address:
public async Task UpdateOrderAddress(...