c#

C# Convert Char to Int

Once again I decided to make a new task from LeetCode and finally my process had been stopped. I could not convert Char to Int. I even spent some time for research, but I could not find any solution. Then I open the documentation and started to read. Read more»

.Net & C#

Render and Save PDF file from HTML in MVC 5 Application

In my application I had rendered JSON data with AngularJS and I had to send it to a controller in my MVC application to render PDF file and to allow a user to save it. So, the task was dynamically to submit the request, render a file and allow user to save it. Read more»

.Net & C#

StreamWriter – how not to clear existing text

StreamWriter has some options of usage. You can as add new text to an existing text in file, so and to clean existing text and add a new one. Read more»

.Net & C#

C# Convert DataTable to List generic collection

C# snippet below helps to read SQL data to List<T> generic collection without any extensions or frameworks only with SQL and LINQ. Read more»

.Net & C#

CRC has failed with DotNetZip (Ionic.Zip) library

Junior developer created some tools which packed to zip-archive some rendered files. He used for this DotNetZip (Ionic.Zip) library. Everything worked fine until today. But today, when users users tried to open zip-file, they’ve got the error “CRC has failed, the file is corrupt”. Read more»

.Net & C#

Reading and querying XML file in C#

Reading and querying XML data is good with Link to XML in C#. LINQ to XML provides an in-memory XML programming interface that leverages the .NET Language-Integrated Query (LINQ) Framework. Read more»

.Net & C#

Read CSV file to List<T> using CSVHelper

CsvHelper

CsvHelper is a very good library for reading and writing CSV files. It’s really easy for coding and fast for work. You can install it via Nuget in Visual studio or download from the project page in GitHub https://github.com/JoshClose/CsvHelper.  Read more»

.Net & C#

C# WebClient return an error (401) Unauthorized. Easy fix

My code in C# console application used to download an image from web service and store it in SharePoint library. But some why the code always returned an error “(401) Unauthorized”. The requested URL has been successfully opened in browser on the same machine. Read more»

.Net & C#

Popular Posts