10,642 questions with C#-related tags

Sort by: Updated
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,325 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,642 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,642 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,642 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,872 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,886 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,642 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 51,346 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,642 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,710 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,642 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,642 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,586 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,642 questions
asked 2020-12-15T11:10:12.35+00:00
youki 1,016 Reputation points
commented 2020-12-22T08:57:56.513+00:00
youki 1,016 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,642 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,642 questions
asked 2020-12-18T17:47:49.617+00:00
Naomi 7,366 Reputation points
commented 2020-12-22T06:01:52.57+00:00
Timon Yang-MSFT 9,586 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,642 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,642 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,642 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
2 answers

Deserialize under other class name, or change class name in serialized document c#

I c# would like to change the name of a class that is being persisted through serialization/deserialization (using a binary formatter). If I simply refactor the name to another name, the desirialization of the file won't load (nor did I expect this). …

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,642 questions
asked 2020-12-18T16:50:10.383+00:00
Zoidboom 21 Reputation points
answered 2020-12-21T06:19:08.257+00:00
Timon Yang-MSFT 9,586 Reputation points
2 answers

Pass parameter to ViewModel through DataTemplate?

I want to pass an ID value from the MainWindow as a paramter to the ViewModel used in a TabControl within the MainWindow. The TabControl displays the associated View using a DataTemplate. How can I accomplish this? MainWindow looks like this: …

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,710 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,642 questions
asked 2020-12-18T14:47:13.347+00:00
rcmp-adu 1 Reputation point
answered 2020-12-21T05:44:42.227+00:00
DaisyTian-1203 11,621 Reputation points
1 answer

How to call the Function in MVVM pattern design

I have a byte array to image converter method that converts image stored as byte array in SQL server database to image type for display in the image control. I am confuse on how to call the method to display the image. I am using mvvm pattern. Here is my…

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,352 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,642 questions
asked 2020-12-19T19:34:42.22+00:00
DPlug 41 Reputation points
commented 2020-12-20T15:59:12.36+00:00
DPlug 41 Reputation points
1 answer

How add my picture from source property of image control (WPF) at Access Database?

Hi to all First and foremost, I apologize for my grammatical errors; my first language is Persian (Iran). First question: tell me what the data type should be to save the image in Access(2007) for example "ole object" or "memo" or…

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,710 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,642 questions
asked 2020-12-20T05:23:20.21+00:00
رضا جافری 1,296 Reputation points
answered 2020-12-20T08:53:16.12+00:00
Castorix31 83,201 Reputation points
1 answer One of the answers was accepted by the question author.

Stack Data Structure

I got the difference between queue and stack, but my question is do we really need stack in real life? Except computer algorithms, when LIFO will come handy?!

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,642 questions
asked 2020-12-20T03:43:36.9+00:00
Tes Gam 81 Reputation points
accepted 2020-12-20T04:08:26.537+00:00
Tes Gam 81 Reputation points
3 answers

OpenSubKey() Registry key's “Absolute Path”?

Using Microsoft.Win32.RegistryKey C# functions which require a registry path, like OpenSubKey(), using a path like @"SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" generates an error stating “Absolute path information is…

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,519 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,642 questions
asked 2020-12-14T12:27:26.733+00:00
Marc George 21 Reputation points
answered 2020-12-20T01:50:41.333+00:00
Marc George 21 Reputation points
1 answer One of the answers was accepted by the question author.

C# - BlockingCollection

Hello, public static async Task BC_AddTakeCompleteAdding() { using (BlockingCollection<int> bc = new BlockingCollection<int>()) { // Spin up a Task to populate the BlockingCollection …

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,642 questions
asked 2020-12-17T13:52:04.11+00:00
Markus Freitag 3,786 Reputation points
accepted 2020-12-19T11:32:57.497+00:00
Markus Freitag 3,786 Reputation points