C# windows form crash
Hi, I'm writing my Windows forms project in C# using the latest versione available of Visual Studio Community (17.9.3). The project manages a Modbus TCP client connection using the NModbus library to a proprietary and tested server. The connection is…
Number of query values and destination fields are not the same
Hi All, I received the TXT files from my vendor every morning. My objective is to convert this TXT file into Excel (.xlsx) file for my internal customer. I would appreciate it if you can point me in the right direction to resolve the issue. Thank you; I…
Window.GetWindow() of TabItems content does not return the right window when TabItems State changes
When using TabControl in two windows, each TabItem contains a button with a click event that displays the parent window of the TabItem using Window.GetWindow(). After DragAndDrop a TabItem from one window to another, GetWindow() still returns the…
Accessing certificates local storage
Hello All, We wanted to know a few things about the certificate management store and accessing the certificates using C#: Are the certificates installed in the 'Certificate Management Store' (both current user and local computer) stored in any default…
UWP How to cancel a file search
I have a code to search for files in a user's selected folder, the file search takes some time and I need to be able to cancel it if the user changes the folder QueryOptions options = new QueryOptions(CommonFileQuery.OrderByName, filesExtensions) {…
what is the new technology to replace MFC?
I'm looking to develop a new software to replace a current version (this is a software that shows map and tracks fast moving vehicles). The current version was written in MFC C++ and MFC is becoming obsolete. My question is what new tools from Microsoft…
Taskbar Color Reverts When Changing Color Using SetWindowCompositionAttribute in WinUI3
Hi, I am encountering an issue with the taskbar color on Windows. When I change the taskbar color using the SetWindowCompositionAttribute method, the color initially changes as expected. However, as soon as I click the 'Start' button, the taskbar color…
MSI application uninstall not working properly after windows update
While uninstalling our MSI Application, we have shown a custom exception message when MSI application is running in the background. To show custom message we have override the installer file . namespace SampleApplication { [RunInstaller(true)] …
There is no ViewData item of type 'IEnumerable<SelectListItem>' that has the key 'TenDonVi'.
At the first time, I used like this and it worked well, there is no error about this: (Controller) public ActionResult EditNV(int? id) { var nhanVien = db.NhanViens.Include(nv => nv.LichSus).FirstOrDefault(nv => nv.MSNV…
How to binding ViewModel's SearchText variable to the DataGrid Cell as a converter parameter?
I've an other question: How to binding ViewModel's SearchText variable to the DataGrid Cell as a converter parameter. I'm using a converter to change ViewModel's list's field name: "content" to highlightedText textBlock. but the Convert method…
Is the October 2024 MFA enforcement applied on MSAL.NET accessing the Microsoft Graph API?
As mentioned on many channels Microsoft want to enforce MFA on administration portals, Azure CLI, Azure PowerShell, Azure Mobile app and IaC…
converting VB asc() to C# Code
I'm trying to convert the following VB code to C# I'm stuck on the C# equivalent of VB's ASC this //Newstr = Newstr & chr(asc(Mid(str,x,1)) - Asc(Mid(key,KeyPos,1))) to this Newstr = Newstr & Convert.ToChar(asc(reverseString.Substring(x, 1)) -…
What is the largest integer number that can be stored in a float in C#?
Hello, According to Microsoft Docs, we can store an integer up to 3.4 * 10^38, so why can't I store 100,000,001 in a float? Well, 100,000,001 is less than 3.4 * 10^38.
System.IO.FileNotFoundException: 'Could not find file '
I have the file located in my directory in C:\Users\Cerburus\source\repos\CST-150 ListToGridView\CST-150 ListToGridView\bin\Debug\net8.0-windows\Data\topic6.txt But I keep getting the exception file not found. please I need help internal class…
Can we store/retrieve data from Share Point list using a WPF C# application?
I am working on WPF C# application. Right now, I have the application connected to SQL database to store and retrieve data. However, I am curious to explore the options to replace it with Share Point List. So that, whatever the data I create using my WPF…
how to highlight searched text in DataGrid Cells on WinUI 3 application. Or how to use RichTextBlock in the Datagrid cell?
how to highlight searched text in DataGrid Cells on WinUI 3 application. Or how to use RichTextBlock in the Datagrid cell? I'm writing a C# WinUI 3 Desktop App with DataGrid. And I want to use rich text in the DataGird cell to highlight the searched…
Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException: 'The property or field has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested.'
Hi I am working with retrieving data from a SP list. I am able to connect to the list, get the list name and count the number of records (items) from the given list. Next, I wanted to get the data from a particular columns. Say I have the following…
How to Write/Store data in an Excel spreadsheet that is located at Share Point?
I am working on writing or storing the data into Excel spreadsheet that is located at a Share Point site. I am able to connect to the Share Point site and obtaining the excel spreadsheet by passing the relative URL. Using Memory Stream, the contents of…
C# App doesn't start up when running Appium WDA on iOS
We are using Appium to test our multi-platform app. (Windows, Android, iOS). This App is written using C# in .Net 8 with MVVMCross. However, since about month or 2 ago, our App crashes on start up on iOS when the Appium xcuitest WebDriverAgent is…
.Net MAUI Binding for ListView ItemSelected
Hi all, I am trying to bind the ItemSelected of a ListView to a View Model, but am experiencing some issues (due to my own misunderstands around how it all works). I have view: <?xml version="1.0" encoding="utf-8" ?>…