C# code examples

Please find below a list of c# programming examples designed in visual studio

The .NET platform

.NET is a developer platform made up of tools, programming languages, and libraries for building many different types of applications.

The base platform provides components that apply to all different types of apps. Additional frameworks, such as ASP.NET, extend .NET with components for building specific types of apps.

ASP.NET extends .NET

ASP.NET extends the .NET platform with tools and libraries specifically for building web apps.

These are some things that ASP.NET adds to the .NET platform:

  • Base framework for processing web requests
  • Web-page templating syntax, known as Razor, for building dynamic web pages using C#
  • Libraries for common web patterns, such as Model View Controller (MVC)
  • Authentication system that includes libraries, a database, and template pages for handling logins, including multi-factor authentication and external authentication with Google, Twitter, and more.
  • Editor extensions to provide syntax highlighting, code completion, and other functionality specifically for developing web pages

More information can be found at https://dotnet.microsoft.com/learn/aspnet/what-is-aspnet

Output Cache In MVC

In this blog, I will show you how to use Output Cache In MVC and a catch that you need to be aware of.


C# for loop with working example to download from GitHub

In this blog post, i will show you how to use C# for loop with working example to download from GitHub


C# send email with attachment with working code example.

C# send email with attachment with working code example to download from GitHub


C# pagination example with working code to download from GitHub

This blog has a C# pagination example with working code to download from GitHub for you to use.


C# random number generator with real world example

C# random int with a real-world example and why not to use Random for anything slightly complex.


SQL server bulk insert with real world example

SQL Server bulk insert with a real-world example using ASP.Net C#


WebApi Get Using jQuery

WebApi Get - In this blog I will show you how to return data using jQuery, RoutePrefix and Route


List add new object c#

List add new object C# - In this blog, I will show how to add an item to the beginning of a list.


How To Compare Two List in C#

In this blog, I will show you one way on how to compare two lists in c#


String or binary data would be truncated

System.Data.SqlClient.SqlException (0x80131904): String or binary data would be truncated. It is not all that it makes out to be.