Hi, have a "System.Reflection.TargetInvocationException Message=Exception has been thrown by the target of an invocation.
Hi, this exception is being thrown on code that earlier worked fine. It is a message posting call only, sending a phrase to a message
C# from text file to XML with structure
Hello, I get a list of numbers in an array. What is the easiest way to create an XML file from this? …
How to get past SecurityException accessing Registry?
In the Microsoft documentation for System.Console (https://learn.microsoft.com/en-us/dotnet/api/system.console?view=net-5.0#examples) there is an example related to "font linking". One part of that example is shown in the code snippet …
Roles question for situation where a user can login as other users
I am building an application Blazor Serverside) where a user can join, get a membership (Customer) and then fill out information on various pages. The other pathway is that they hire someone to do this for them (Pro) and that someone may ask them to…
How to Create an expression tree with Any(p => list.Contains(p))
I want to allow users to define some custom queries/business rules and use those definitions to dynamically generate a query. I found this post by Jeremy Likness that gives an idea of what I'm shooting for. However, there is one specific case that I…
Microsoft.EntityFrameworkCore.Sqlite C# ulong (64 bit integer) could not be translated (LINQ query)
Hi! I'm testing database code migration from .NET Framework to .NET 5.last. I'm using .NET 5, Microsoft.EntityFrameworkCore.Sqlite & LINQ query. (all last varsions) Following pseudo-code fails when using correspondence C#: ulong type…
MailKit Wont Authenticate when trying to send email via SMTP
I am developing an app that prompts a user to enter input to be emailed from a contact form. Unfortunately I am unable to authenticate the email address I am using (535 code). However, I have unsubscribed and resubscribed the account name and changed the…
Error when checking if a date in Access Database table
Backend database: Access (date format: yyyy-mm-dd). It returns error when I run below code. Thanks. public static bool isDateInDatabaseTableAppointment(DateTime dt) { OdbcConnection Cn = new…
Virtual key codes not working as expected
Hello, I'm programming an application where i use virtual scan codes that i get by virtual key codes (MapVirtualKey) for automating shortcuts. I've discovered that several key codes doesn't work as expected. For example: Tested key combinations…
Xamarin android emulator black screen/Can`t run blank project
All in title. At the first: Hyper-v is enable, processor - amd, i dont have HAXM. What i`m tried: Set Release mode and in advanced settings enable x86 architacture. No errors in logs, i just tilted and cant start developing on Xamarin. I`m also…
Pointer to Structure (void*)
Hello I got crash object reference not set to an instance of an object while doing this : [DllImport("ntdll.dll")] public static unsafe extern NTSTATUS NtQueryInformationProcess( IntPtr ProcessHandle, …
Windows.Media.SpeechSynthesis.SpeechSynthesizer constructor throws file not found exception
A lot of users for my UWP app are hitting System.IO.FileNotFoundException in the Windows.Media.SpeechSynthesis.SpeechSynthesizer..ctor() The code is calling the default constructor of Windows.Media.SpeechSynthesis.SpeechSynthesizer private…
C# - LinQ query take it, save it problem
Hello, I need to read in an xml file and need to take out n elements and save them again. Sample: TakeElements(int count); Call with TakeElements(5); <SERIALS> <POS index="1" content="AAA5SUU"…
C# Files older than 20 days -> delete it automatically
Hello, I have a work folder and a folder "IsDone". C:\Share\Work\ C:\Share\IsDone\ I need to delete files there without asking that are older than 20 days. How can I do this without blocking the application? I need one thread, one…
How to connect ESPnow to C#
ESPnow is a protocol to connect one Espressif device to another over WiFi , such as ESP32 or ESP8266, WEMOS etc. the advantage is that it is not relying on local WiFi network, so no need to select a WiFi Network and register to it with a password. I…
Can XAML “deduce” inheritance from C#?
I wonder if XAML is somehow able to "deduce" the C# inheritance. Let me explain: I have these two C# classes: public class AStyleSelector: StyleSelector { public Style aStyle { get; set; } public override Style SelectStyle(object item,…
C#: how to write date(dateTimePicker) as criteria?
Backend database: Access Access date format: yyyy-MM-dd I am trying to match dateTimePicker format same as Access date format, but it does not recognize the way I wrote. Thanks. string sqlDelete = "DELETE FROM TableAppointment…
Converting excel macro to C#
I am creating excel VSTO , where I already have the macro to delete excel rows based on column values(if it is greater than zero)which now needs to be converted to c# , by seeing documentation on internet I have come up so far , but still three errors…
Retrieve programmatically SharePoint Online storage space
How can I retrieve programmatically SharePoint Online allocated (purchased) storage space of the whole tenant, which is visualized "In the upper right of the page": …
String connection to remote server
Hello, everyone, I have a question about how to connect a .NET application (programmed in C#) to a database (BaseX) of a SQL Server instance (ServerX) through a SQL user (Usser: UserX, Password: PasswordX) located in a remote server which can be…