Skip to main content

All Questions

Tagged with
0 votes
0 answers
29 views

Binding data inside a DataGrid inside a DataGrid.RowDetailsTemplate / C# WPF

I'm learning C# and WPF for a personal project that I'll use for my job. I'm trying to create a DataGrid inside another DataGrid. Specifically, I want my first SQL query to display some data, and when ...
0 votes
2 answers
62 views

Why do I need to model a join table class?

I have two classes in C#: public class Student { public string Name {get; set;} public string Email {get; set;} public List<Course> Courses {get; set;} } public class Course { ...
0 votes
0 answers
29 views

Error "To change the IDENTITY property of a column, the column needs to be dropped and recreated."

I'm a beginner and i am having this error when i use the update-data base, after the migration: "To change the IDENTITY property of a column, the column needs to be dropped and recreated." ...
0 votes
2 answers
1k views

Improve SqlBulkCopy performance on high amount of nvarchar(max)

I want to copy data between two tables with SqlBulkCopy. So first I defined a statement that contains the where clause (where ID IN (...)) in my table that defines which entries should be copied. (In ...
0 votes
2 answers
57 views

Logic edits all existing rows instead of adding new when using Save stored procedure

I have an issue regarding SQL stored procedures. I have connected my SQL Server db to my ASP.NET Web Forms app and have created a button that uses Stored Procedures to Save data inside the db. I only ...
-3 votes
1 answer
80 views

I cannot modify the table in my database with C# [closed]

I created a database and a table in Microsoft SQL Server, and I want to do some experiments with it in C#. I successfully connected to my database and I can read the first row of the table, too. But ...
3 votes
1 answer
88 views

Join tables with condition that all row values are unique

I have tables Machine and Inventory. In table Machine I have last running inventory properties. In table Inventory, I have new inventory id and properties (Not yet run in machine). I have to return a ...
0 votes
1 answer
33 views

Transaction Log for database is full because update file about 100mb

I try to insert the data of a file about 100mb in size by splitting it into parts, each about 65,000 characters into the sql server. The first time I insert it and the next time I update that data. ...
2 votes
5 answers
11k views

Unable to create a 'DBContext'

i have the following error message: Unable to create a 'DbContext' of type ''. The exception 'No database provider has been configured for this DbContext. A provider can be configured by overriding ...
0 votes
0 answers
28 views

Use some kind of helper function In EF Select query to make subquery [duplicate]

I have several tables that handles different kinds of translations for my entities and those tables to linked via relations to other entities. I use subquery to directly access translations tables ...
0 votes
1 answer
69 views

String interpolation inside a formattable string in C#

I am in the process of replacing Dapper with EF Core in a project. Specifically using the new Database.SqlQuery and Database.ExecuteSql functionality with EF Core. I like how they use ...
389 votes
9 answers
501k views

What represents a double in sql server?

I have a couple of properties in C# which are double and I want to store these in a table in SQL Server, but noticed there is no double type, so what is best to use, decimal or float? This will store ...
8 votes
5 answers
12k views

The named 'CommandType' does not exist in the current context

Can someone help me understand why I'm getting that error here? using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Threading.Tasks;...
0 votes
0 answers
33 views

How to map value objects in dapper

i have the following entity using MedRaise.Domain.Enums; namespace MedRaise.Domain.Entities; public class Appointment : Entity { private Guid _clinicId; private DateTime _date; private ...
2 votes
0 answers
59 views

How to convert this SQL query to NHibernate IQueryable query?

I have to create a query similar to the one below to paginate a parent-child query: SELECT v.ProductId, MAX(v.Price) AS Price FROM Variant v GROUP BY v.ProductId ORDER BY Price ASC; I am using C# ...

15 30 50 per page
1
2 3 4 5
2205