10,249 questions with C#-related tags

Sort by: Updated
3 answers One of the answers was accepted by the question author.

Everything is an error on VS2019 but not VS2017, why?

Hopefully someone can help, I have an android project, works fine with VS2017, but when I open it in VS2019 everything is red(ie: The type or namespace 'System' could not be found...). All the references are shown with a yellow icon, unless I click on…

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,249 questions
asked 2020-12-22T00:21:45.387+00:00
Phunction 206 Reputation points
accepted 2020-12-23T17:55:43.963+00:00
Phunction 206 Reputation points
1 answer One of the answers was accepted by the question author.

INotifyDataErrorInfo implementation for several values, check that there are no errors in Dictionary (WPF MVVM)

I have been trying to implement INotifyDataErrorInfo and everything seems to be working except SaveSettings() and especially bool HasErrors. Can somebody please tell me why and how to fix it? I mean that SaveSettings is always triggered, even if there…

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,671 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,249 questions
XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
764 questions
asked 2020-12-22T22:08:25.157+00:00
mrw 201 Reputation points
accepted 2020-12-23T12:45:37.257+00:00
mrw 201 Reputation points
1 answer One of the answers was accepted by the question author.

Web request not going through with TLS 1.2 enabled in registry in C# application

I have a C# windows application and I am trying to make a web request on a URL using HttpWebRequest. I have enabled TLS 1.2 in the registry at below location …

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,249 questions
asked 2020-12-16T12:53:35.62+00:00
Deepika 21 Reputation points
commented 2020-12-23T12:14:45.68+00:00
Deepika 21 Reputation points
4 answers

How do I pass DataGridView selected row value to TextBox in another form?

hello all , i am very new to c# I am creating a small data entry application using WinForms and MSSQL database , In this i need to pass Datagridview selected row value to the textbox , combo box in another form? the datagridview form:…

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,829 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,607 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,249 questions
asked 2020-12-21T05:44:34.287+00:00
ravi kumar 331 Reputation points
answered 2020-12-23T08:35:04.543+00:00
Abdulhakim M. Elrhumi 351 Reputation points
1 answer One of the answers was accepted by the question author.

cryptographic service provider (CSP)

Hi Initializes an instance of System.Security.Cryptography.MD5CryptoServiceProvider. it's work in source code run. but after compiler my code and run exe file not work under windows 10 64bit. public static string EncryptPassword(string s) { …

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,249 questions
asked 2020-12-22T16:02:32.29+00:00
Abdulhakim M. Elrhumi 351 Reputation points
commented 2020-12-23T07:10:06.087+00:00
Lex Li (Microsoft) 4,742 Reputation points Microsoft Employee
2 answers One of the answers was accepted by the question author.

disable button for user login in winforms

in my winform application , i have 3 forms , Login form Main form Data entry form when the login is "User" , Main form should open , but in the childform "data entry" - "button1" should be disabled. when the…

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,829 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,607 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,249 questions
asked 2020-12-22T04:38:49.41+00:00
ravi kumar 331 Reputation points
answered 2020-12-23T03:52:51.26+00:00
Karen Payne MVP 35,036 Reputation points
1 answer

C# Interop.Excel AddIn Error

Run Excel.exe Run C# Program -> Interop.excel ![50303-image.png][2] My SourceCode Excel.Application excel = new Excel.Application(); Excel.Workbooks workbooks = null; …

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,249 questions
asked 2020-12-22T04:18:10.79+00:00
채훈 이 1 Reputation point
commented 2020-12-23T01:47:06.923+00:00
Timon Yang-MSFT 9,571 Reputation points
1 answer One of the answers was accepted by the question author.

What to do with its Java Native Interface library file in its filepath?

I have installed or unzipped the Java Native Interface or JNI library onto my desktop. What I want to perform next is how to reference its file path within the Xamarin IDE in Visual Studio. This question applies to the following: Visual Studio 2019…

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,294 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,249 questions
asked 2020-12-20T02:38:41.08+00:00
JohnCTX 636 Reputation points
accepted 2020-12-23T01:15:36.76+00:00
JohnCTX 636 Reputation points
0 answers

C# Xamarin Forms InAppBilling PurchaseAsync not returning after handle of playstore

I am using jamesmontenegro InAppBilling and I have a small issue regarding payments. The code is working fine but after the payment is handled by Google Play Store, the app doesn't handle the procedure and doesn't return if the purchase was successfully…

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,249 questions
asked 2020-12-22T23:05:41.493+00:00
lb 1 Reputation point
2 answers One of the answers was accepted by the question author.

Check if Checked doesn't work

Why doesn't this work? if (postonly_check.Checked) { fee_double = 0.025; } I researcht and anybody said that postonly_check.Checked works.

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,249 questions
asked 2020-12-21T14:30:01.037+00:00
RobinJ 276 Reputation points
accepted 2020-12-22T22:01:52.47+00:00
RobinJ 276 Reputation points
1 answer One of the answers was accepted by the question author.

get data from sql table throwing null exception even when try block is present

In my WinForms app, i have this below code which fetches the lot number from MSSQL table when the button is clicked , private void getlotnumbers() { try { SqlConnection con = new SqlConnection(cs); …

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,829 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,607 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,249 questions
asked 2020-12-21T07:15:59.803+00:00
ravi kumar 331 Reputation points
commented 2020-12-22T14:20:21.353+00:00
Michael Taylor 48,281 Reputation points
1 answer One of the answers was accepted by the question author.

How to read Excel Marco (.xlsm) file

Hi all, I have code like below to read Excel Macro (.xlsm) file; Microsoft.Office.Interop.Excel.Application objExcel = new Microsoft.Office.Interop.Excel.Application(); object missing = Type.Missing; …

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,249 questions
asked 2020-12-21T08:15:41.313+00:00
c ahmad shukri Yong 26 Reputation points
commented 2020-12-22T10:51:24.39+00:00
c ahmad shukri Yong 26 Reputation points
1 answer One of the answers was accepted by the question author.

Clickonce update problem

I'm not good at clickonce so I need help to solve my problem. I made a application, and I trying to deploy my app via clickonce. But, I do not want to auto update by clickonce.(this clickonce from .net framework folder) So I uncheck all of…

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,671 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,249 questions
asked 2020-12-21T07:28:57.473+00:00
Kyeongdon Lim 41 Reputation points
accepted 2020-12-22T09:50:54.603+00:00
Kyeongdon Lim 41 Reputation points
2 answers

how to use http listner in windows forums c# app

Hi, I am trying to convert twain(windows forums) into API using HTTP listener in windows forums. But my window keeps freezing. I believe my code is not sending event messages to a main window handle forum when a window is created on that thread when…

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,249 questions
asked 2020-12-16T08:04:45.15+00:00
manjunath 1 Reputation point
answered 2020-12-22T09:50:44.407+00:00
Timon Yang-MSFT 9,571 Reputation points
1 answer

Set foreground of child window in Visual Studio

I want to set the foreground of a window in Visual Studio. What i've tried: When i have 2 windows "docked" side by side i can't set the foreground of a window under the mouse in VS. I'm using GetCursorPos and WindowFromPoint which usually…

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,249 questions
asked 2020-12-15T11:10:12.35+00:00
youki 996 Reputation points
commented 2020-12-22T08:57:56.513+00:00
youki 996 Reputation points
2 answers One of the answers was accepted by the question author.

C# - (this T obj) - feature name

Hello, I have a function like this. Works well, but why? public static string ToXML<T>(this T obj) I call it without parameter! I think the reason is this What is this mechanism called? How can I see if this exists, perhaps via…

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,249 questions
asked 2020-12-21T10:42:17.71+00:00
Markus Freitag 3,786 Reputation points
commented 2020-12-22T06:54:45.073+00:00
Markus Freitag 3,786 Reputation points
1 answer

Logging problem using the Reader.Read() and lots of processing inside

Hi everybody, I've been working on changes in the application written by someone else. The way the program is structured is that the query is executed into a reader (it may return up to 300 rows). It then reads data and saves them into public fields of…

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,249 questions
asked 2020-12-18T17:47:49.617+00:00
Naomi 7,361 Reputation points
commented 2020-12-22T06:01:52.57+00:00
Timon Yang-MSFT 9,571 Reputation points
2 answers One of the answers was accepted by the question author.

Quaternion

Hi, what's the difference between concatenate and multiply quaternion in C#?? Thanks

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,249 questions
asked 2020-12-18T16:20:14.467+00:00
ryan G 21 Reputation points
commented 2020-12-21T09:38:08.373+00:00
ryan G 21 Reputation points
3 answers One of the answers was accepted by the question author.

C# - Create unique one-of-a-kind numbers, like GUID

Hello, <message> <header> <to>companyReceiver</to> <from>companySender</from> <type>saveInvoice</type> </header> <body> <saveInvoice> **<invoice…

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,249 questions
asked 2020-12-18T08:51:33.06+00:00
Markus Freitag 3,786 Reputation points
accepted 2020-12-21T07:26:33.453+00:00
Markus Freitag 3,786 Reputation points
1 answer One of the answers was accepted by the question author.

Can't enable debug layer

I'm using TerraFX DirectX wrapper in a Desktop.WinUI project / .Net 5. I've enabled the debug layer with the following code. cs ID3D11Device* CreateD3DDevice(out ID3D11DeviceContext* pImmediateContext) { …

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,249 questions
asked 2020-12-21T05:44:50.09+00:00
Gavin Williams 761 Reputation points
accepted 2020-12-21T06:24:43.37+00:00
Gavin Williams 761 Reputation points