Home Tags Privacy About

All posts tagged with "C#"

C# (C-sharp) is a general-purpose programming language using strong typing, It was developed around 2000 by Microsoft and used on the .Net platform.

← Newer Posts Page 5 of 13 Older Posts →

C# Dapper - How to make select, insert, update and delete statements

Dapper makes it easy to "Execute a query and map the results - if any - to a strongly typed List". This post demonstrates »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C#, MSSQL, Dapper 13 June 2022

C# Dapper - Return inserted identity

This post describes two ways to get the generated identity of a newly inserted row. We will use the following table simple table with an Id »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C#, MSSQL, Dapper 12 June 2022

C# - How to use the DataContractSerializer to serialize or deserialize XML

One way to deserialize XML is using the DataContractSerializer. You can read XML and deserialize it into an object or serialize an object into XML. If »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C# 10 June 2022

C# - program does not contain a static 'main' method suitable for an entry point

A common reason for this error is that you using the wrong type of project output. In Visual Studio try the following and rebuild: * Right click »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C# 10 June 2022

C# - How to deserialize a list of strings using the DataContractSerializer with ReadObject

I found many examples on how to do this around the internet: * DataContractSerializer Deserialize list not working * How to Deserialize XML using DataContractSerializer * DataContractSerializer Class But »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C# 08 June 2022

C# - Should you reuse your HTTPClient? or dispose it after every request?

I have always been told to reuse the HttpClient throughout the application lifetime for better performance and stability. If you search for why, there are quite »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C#, HttpClient 06 June 2022

C# - How to add or remove headers using the HttpClient

You can set default headers on the HttpClient using the DefaultRequestHeaders property: _httpClient.DefaultRequestHeaders.Add("MyFantasticHeader" ,"MyFantasticValue"); var result = await _httpClient.GetAsync( »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C#, HttpClient 06 June 2022

C# - How to return a named tuple from a method

You are probably here because you have forgotten the syntax for returning a tuple from a method. To be honest that is also the reason why »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C# 04 June 2022

C# - How to create a named tuple or list of named tuples

There are two reasons you are on this page: 1) you forgot the syntax for named tuples 2) You have just learned about named tuples and »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C# 04 June 2022

C# - How to connect to a MSSQL database using a SqlConnection

You can use the SqlConnection class to connect to a MSSQL server. If we have a database called MyDb with a simple table called MyEntities: CREATE »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C#, MSSQL 01 June 2022
← Newer Posts Page 5 of 13 Older Posts →
  • Rss
  • Twitter
  • LinkedIn
  • profile for Peter Rasmussen at Stack Overflow, Q&A for professional and enthusiast programmers
Peter Daugaard Rasmussen - developer, Consultant, Blogger © 2025 Privacy policy