Top ".net" questions

Do NOT use for questions about .NET Core - use [.net-core] instead.

How do I make a textbox that only accepts numbers?

I have a windows forms app with a textbox control that I want to only accept integer values. In the …

c# .net winforms textbox
How do I create an Excel (.XLS and .XLSX) file in C# without installing Microsoft Office?

How can I create an Excel spreadsheet with C# without requiring Excel to be installed on the machine that's running …

c# .net excel file-io
What is the difference between String and string in C#?

Example (note the case): string s = "Hello world!"; String s = "Hello world!"; What are the guidelines for the use of …

c# .net string types alias
Calling the base constructor in C#

If I inherit from a base class and want to pass something from the constructor of the inherited class to …

c# .net inheritance constructor
How do I display a decimal value to 2 decimal places?

When displaying the value of a decimal currently with .ToString(), it's accurate to like 15 decimal places, and since I'm using …

c# .net format decimal
How can I get the application's path in a .NET console application?

How do I find the application's path in a console application? In Windows Forms, I can use Application.StartupPath to …

c# .net console console-application
Reading settings from app.config or web.config in .NET

I'm working on a C# class library that needs to be able to read settings from the web.config or …

c# .net configuration appsettings
Run Command Prompt Commands

Is there any way to run command prompt commands from within a C# application? If so how would I do …

c# .net command-line command prompt
Difference between decimal, float and double in .NET?

What is the difference between decimal, float and double in .NET? When would someone use one of these?

.net floating-point double decimal
LINQ query on a DataTable

I'm trying to perform a LINQ query on a DataTable object and bizarrely I am finding that performing such queries …

c# .net linq datatable .net-3.5