C# snippet below helps to read SQL data to List<T> generic collection without any extensions or frameworks only with SQL and LINQ.
C# snippet below helps to read SQL data to List<T> generic collection without any extensions or frameworks only with SQL and LINQ.
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...)
You can get list of available NuGet packages for Visual Studio using Package Manager Console (in VS – Tools / NuGet Package Manager / Package Manager Console).
Here's a useful snippet in C#. This method gets all the images from variable type String. It can be HTML or XML text with tags <img src="path_to_image">
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.
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...)
When I was developing a web service for SharePoint 2010 I had to fill in "assembly strong name" in .asmx file. Below I repost a very nice method how to get an "assembly strong name" in Visual Studio.
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.
There is a rather pretty solution how to get all the items from one generic collection (List<T>) which are not presented in the second one.
Writing connection string manually is one of the worst things in software development. That's why I always want them to be generated by any tool but not by me. Some times before I have found a way how to generate a connection string creating an .udl file in Windows (https://markimarta.com/c/how-easily-write-the-text-of-connection-string/). Now I've found a better way.