10,863 questions with C#-related tags

Sort by: Updated
1 answer

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…

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,885 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,863 questions
asked 2024-03-13T10:22:08.48+00:00
Isacco Simonini 5 Reputation points
commented 2024-09-13T14:27:01.4466667+00:00
CH Abdullah 0 Reputation points
0 answers

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…

Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,852 questions
SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,568 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,863 questions
asked 2024-09-12T19:13:54.43+00:00
Douang Rintharamy 0 Reputation points
commented 2024-09-13T13:47:19.7866667+00:00
Yitzhak Khabinsky 25,851 Reputation points
1 answer

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…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,811 questions
Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,763 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,863 questions
asked 2024-08-02T05:27:50.5833333+00:00
Karthick Arjunan 0 Reputation points
commented 2024-09-13T13:15:23.24+00:00
Karthick Arjunan 0 Reputation points
1 answer One of the answers was accepted by the question author.

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…

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,863 questions
asked 2024-09-12T12:16:05.4166667+00:00
S Abijith 386 Reputation points
accepted 2024-09-13T11:48:22.1866667+00:00
S Abijith 386 Reputation points
0 answers

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) {…

Universal Windows Platform (UWP)
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,863 questions
asked 2024-09-10T15:14:33.9233333+00:00
Arsen Kovalchuk 0 Reputation points
commented 2024-09-13T09:33:56.8033333+00:00
Junjie Zhu - MSFT 17,401 Reputation points Microsoft Vendor
2 answers

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…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,811 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,863 questions
asked 2022-12-01T23:18:46.54+00:00
Henry Tai 6 Reputation points
commented 2024-09-12T15:40:52.88+00:00
tomohiro r 0 Reputation points
1 answer One of the answers was accepted by the question author.

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…

Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
5,341 questions
Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
781 questions
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,596 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,863 questions
asked 2024-09-10T06:38:06.4466667+00:00
Jacob Mordon 225 Reputation points
accepted 2024-09-12T08:54:13.6366667+00:00
Jacob Mordon 225 Reputation points
0 answers

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)] …

Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
5,341 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,863 questions
asked 2024-09-12T06:16:40.4833333+00:00
Test Admin 176 Reputation points
edited the question 2024-09-12T07:42:44.51+00:00
Jiale Xue - MSFT 44,756 Reputation points Microsoft Vendor
2 answers

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…

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,464 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,863 questions
asked 2024-09-04T07:26:26.52+00:00
tran huy 0 Reputation points
commented 2024-09-12T06:36:56.8466667+00:00
Lan Huang-MSFT 29,246 Reputation points Microsoft Vendor
0 answers

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…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,811 questions
Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
781 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,430 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,863 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
9,505 questions
asked 2024-09-11T08:59:17.1733333+00:00
EdgeMac 20 Reputation points
commented 2024-09-12T03:19:03.79+00:00
Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 30,746 Reputation points Microsoft Vendor
1 answer One of the answers was accepted by the question author.

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…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,811 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,902 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,863 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,952 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
21,506 questions
asked 2024-09-10T15:39:09.63+00:00
Robin Bouwmeester 21 Reputation points
edited the question 2024-09-12T01:19:55.6466667+00:00
Xyza Xue_MSFT 24,101 Reputation points Microsoft Vendor
1 answer One of the answers was accepted by the question author.

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)) -…

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,863 questions
asked 2024-09-10T13:39:36.8566667+00:00
tim 160 Reputation points
commented 2024-09-11T20:51:22.2633333+00:00
tim 160 Reputation points
1 answer One of the answers was accepted by the question author.

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.

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,863 questions
asked 2024-09-07T19:38:51.4166667+00:00
Shervan360 1,541 Reputation points
accepted 2024-09-11T14:51:13.6433333+00:00
Shervan360 1,541 Reputation points
2 answers

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…

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,863 questions
asked 2024-09-04T23:26:06.7966667+00:00
Hector A Gonzalez 0 Reputation points
commented 2024-09-11T14:47:55.4033333+00:00
Jiale Xue - MSFT 44,756 Reputation points Microsoft Vendor
2 answers

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…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,811 questions
Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,763 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,863 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,952 questions
asked 2024-08-09T07:31:07.1166667+00:00
Lakshmanan B 81 Reputation points
edited the question 2024-09-11T10:04:53.93+00:00
Yanli Jiang - MSFT 25,786 Reputation points Microsoft Vendor
1 answer One of the answers was accepted by the question author.

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…

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,516 questions
Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
5,341 questions
Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
781 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,863 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
9,505 questions
asked 2024-09-10T14:50:55.9+00:00
EdgeMac 20 Reputation points
commented 2024-09-11T08:52:53.2466667+00:00
EdgeMac 20 Reputation points
2 answers One of the answers was accepted by the question author.

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…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,811 questions
Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,763 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,863 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,952 questions
asked 2024-08-15T08:49:02.92+00:00
Lakshmanan B 81 Reputation points
edited the question 2024-09-11T08:18:21.8466667+00:00
RaytheonXie_MSFT 35,071 Reputation points Microsoft Vendor
1 answer

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…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,811 questions
Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,763 questions
Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,852 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,863 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,952 questions
asked 2024-08-28T10:42:09.1+00:00
Lakshmanan B 81 Reputation points
edited the question 2024-09-11T08:11:37.5066667+00:00
RaytheonXie_MSFT 35,071 Reputation points Microsoft Vendor
1 answer

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
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,430 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,863 questions
asked 2024-09-10T12:05:51.0566667+00:00
Joost Jens 0 Reputation points
commented 2024-09-11T06:46:22.02+00:00
Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 30,746 Reputation points Microsoft Vendor
3 answers One of the answers was accepted by the question author.

.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" ?>…

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,430 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,863 questions
asked 2022-12-30T18:55:05.027+00:00
Gavin Beard 21 Reputation points
answered 2024-09-10T09:50:35.2+00:00
Cliff Choongo 0 Reputation points