Skip to main content

All Questions

Tagged with
0 votes
1 answer
53 views

Good practice for implementing interfaces for 2 databases [closed]

I'm using 2 databases for my project: SQLite and SQL Server. I have an interface with all the needed methods but should I make 2 separate implementations for those 2 db engines? One has: using (...
Nemeles's user avatar
0 votes
1 answer
62 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 ...
Samuel Wahlberg's user avatar
0 votes
0 answers
28 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 ...
user384884's user avatar
2 votes
0 answers
53 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# ...
Mehran Rezaei's user avatar
1 vote
2 answers
104 views

Multiple tables query with repository pattern

I have an ASP.NET Web API project, and have implemented repository and unitOfWork patterns. I currently have a big SQL query that I want to implement in code, it includes a lot of tables and joins. My ...
RifloSnake's user avatar
0 votes
0 answers
43 views

How to pass a specific parameter to my dataset

I have DataTable as a result of executing a stored procedure. The stored procedure is returning a number of tables, therefore Tables[0], Tables[1], etc. I'm trying to query the first table, Tables[0], ...
ichachan's user avatar
  • 649
1 vote
1 answer
55 views

Join tables based on StartsWith function

I have two tables to join. The joining condition is a column that should be like or starts with the other column, not exactly equal. How to do that in Linq? This is my function: public async Task<...
sara's user avatar
  • 135
1 vote
1 answer
90 views

How to properly manage and dispose SqlConnection with SqlCredential in EF Core using Dependency Injection?

I am working on an ASP.NET Core project where I am using SqlCredential for database authentication, provided by a SqlCredentialProvider which is designed as a singleton to ensure a single instance ...
Hao Li's user avatar
  • 26
0 votes
0 answers
25 views

Nhibernate get max items

I have a plan table which is having the following structure id plan_id plan_number 1 1 1 2 1 2 3 1 3 4 2 1 5 2 2 for each plan I would like ...
user14636877's user avatar
0 votes
2 answers
93 views

Convert a string to base 64 using T-SQL

I'm having the issue while converting the string to base 64 for encoding using T-SQL. As I use chatgpt to search and some function like SELECT BASE64_ENCODE (CAST ('hello world' AS varbinary)) SELECT ...
kaito kumon's user avatar
0 votes
1 answer
62 views

Error in Uploading an Image to a localhost SQL server using ASP.NET Core and C#

I want to send image itself to a SQL Server on localhost (send an image from my computer to localhost using ASP.NET Core web service written in C#). I tried this in my client side: OpenFileDialog opf =...
user12235025's user avatar
0 votes
1 answer
33 views

How to select where in dataGridView C#

I using microsoft visual studio, and i have box number in datagridview as follows Box Number 4433002 4433006 4433011 I want do some sql query like "SELECT NOTE FROM TABLE WHERE BOX_NUMBER IN ...
Farrasta Khoirunnas Saum's user avatar
0 votes
0 answers
33 views

Entity Framework Core not recognising mapped user-defined function

I'm using Entity Framework Core with .NET 8 and trying to call a user-defined function from C# code. I'm following the instructions here but have a slightly different use case. Rather than having the ...
amarsha4's user avatar
  • 483
0 votes
1 answer
33 views

local sqlite locked after executing SQL query [duplicate]

i am trying to debug a very strange behavior of my application: the problem is that when the code reach the blob.UploadFileAsync i have an exception saying that the file in question is used by another ...
federico 's user avatar
0 votes
2 answers
110 views

Why isn't searching on an indexed column faster than a string comparison?

I was asked for a demonstration of how searching on an indexed column is faster than searching for a string prefix, so I created a quick test but the results were surprising and I can't see why. The ...
Mark Henderson's user avatar

15 30 50 per page
1
2 3 4 5
2205