Category "c++sharp"

Return ID of newly inserted row on a PostgreSQL database using C# and Npgsql?

I'm building a WinForms project in C# using a PostgreSQL database and the Npgsql framework. For inserting a record, I need to return the ID of the new record.

The logging message template should not vary between calls (CA2254) when only passing on variables

I understand the concept of this warning (similar to this question), but what is wrong with this code? private async Task LogWarningAsync(short? userCodeId,

Strange infinite loop in thread in c# using network sockets

I made a little experiment where a server send continually a message to a client until a second client be connected. Testing with telnet, the first client recei

error 0103 using a switch statement with cross script strings in Unity (C#)

what im trying to do is test a public string named enemyBehaviorStatus that exists on another script in this function, and swap the material accordingly. I can

Linq .Distinct() add extraneous ordering

My entity has a computable geography::point column (represented by DbGeography type in code) When I call a .Distinct() method on query for this entity it adds O

C#, Byte array to System.Drawing.Image error

I am trying to convert some video playback code from Unity to C# WPF, and I have hit a wall with the conversion. I have my video frame as a private byte[] _text

How to restart manually a BackgroundService in ASP.net core

I create the BackgroundService: public class CustomService : BackgroundService { protected override async Task ExecuteAsync(CancellationToken cancellationTo

Private class method or interface? [closed]

I'm working on an app which uses the Factory pattern to create new objects. In the Factory Class I've added a new Private method called SendAp

Cannot Read struct with string from PLC using s7netplus c#

im trying to read this data block from Siemens S1500 PLC using s7netplus libary and my mapped code struct looks like this public struct testStruct {

convert List of string array into xml

I need to convert list of array into xml. In the list the first object is the elements of the xml and from second object onwards it is the values of the element

How to work with Subsonic MySQL in ASP.NET Core 3.1?

What are the requirements and how to work with subsonic in ASP.NET Core 3.1 or later versions? How to build DAL using subsonic in ASP.NET Core 3.1? What is the

How to Order these list of string according to its version

Adding some sample data var list0 = new List<string>() { "MAS_Prod_1.2107.0.8","MAS_Prod_1.2107.0.4","MAS_Prod_1.2107.0.7","MAS_Prod_1.2107.0.12", "MAS_Pr

How do I add a metric name to MetricOrderBy when using Google.Analytics.Data.V1Beta?

I am writing come code in c# with Visual Studio 2022 to fetch Google G4 analytics data and cannot get one piece to work correctly. It is the part where a create

How to jump properly using character controller?

I'm using a character controller for my player movement. I had walking and running working, but I couldn't get the jumping to work. Here is my code: [SerializeF

how to fix this error "Microsoft.Extensions.Azure: Could not load file or assembly 'System.Diagnostics.Tracing, Version=5.0.0.0,"

there’s a problem that I didn’t understand where it came from because the script worked yesterday , I woke up and I found this problem that wasn&rsq

How to use anchor tag as submit button in asp.net razor pages

I have a handler method in razor page with name OnGetExpense(UsePayload payload) page.cshtml: <input type="hidden" asp-for="Filters.From" value="@Model.Filte

Application Insights Telemetry: can you track traces/events/etc. asynchronously?

I am a longtime user of Azure's Application Insights, and I use the TelemetryClient's TrackTrace() and TrackException() liberally in every enterprise applicatio

Single Tenant Application needs to support SSO from a multi-tenant provider dynamically with OpenId Owin

I'm trying to use OpenId to authenticate against a dynamic authority URL. There is an unknown number of different {n-tenant}.identityProvider.com authority URL

How to map Object to KeyValuePair<char, string> using AutoMapper?

I'm trying to map my object model to a KeyValuePair<char, string> but my results are KeyValuePairs where Key = null and Value = null. What's the correct w

How can i ignore Uppercase or lowercase in ado.net linq to sql?

i have this query i want the user to search with the name without uppercase or lowercase , how can i do this ? join Materiel in ds.