There are various cases in which you may want to display results from aggregate functions (Sum, Avg, Count, Min, Max) performed over the columns in the grid in their footer. This post explains how to display aggregate functions in ASP.NET MVC Razor views.
Used Environment for this post: VS 2015 Update 3, ASP.NET MVC 5
For ASP.NET Web Forms, Read following post:
Displaying Total in ASP.NET Gridview Footer Row Without using Template Field
Generally, User submitted images (profile pictures, social media posts, and business documents) are needed to be moderated to protect business and quality. If a large number of images are submitted in an application then manual moderation is time consuming and is not instantaneous. This post explains how to automate image moderation using Azure functions and Cognitive Services. Automated moderation applies machine learning and AI to cost-effectively moderate at scale, without human involvement.
On a web page or application form, it is common to have different master data like Country, State…etc. available in dropdownlist, listbox or any other control. It is needed to read all master data from database and bind to proper controls. This post explains different ways to read master tables with C# and Dapper.
Error: column "Gender" is of type enum but expression is of type text.
Are you getting this error when you are using enum datatype in PostgreSQL database? This blog post explains how to fix the error with C# and Dapper. The following environment is used for this post:
If you are working to integrate your C# application with Microsoft Dynamics CRM, You might need to get the Entity Column List. This article explains how to get the list of entity columns from CRM in C# application.
You need to download the Microsoft Dynamics CRM SDK package and install it, the installation process will extract sdk files and folders.
In this article, we will see different ways to export data to Excel from a web application. It is very common task for web developers. Here are different approaches to do it in ASP.NET – C#:
Using the Excel PIA (primary interop assemblies) to generate a spreadsheet server-side.
It needs Microsoft Office suite installed on your server which is not good. So it is NOT recommended.
Before we get started, let us see the general way to use Session in ASP.NET
if (Session["UserName"] == null)
LabelUserName.Text = "Anonymous";
LabelUserName.Text = (string)Session["UserName"];
You can feel some drawbacks e.g. to check null reference, type safety, to cast object..etc.
Now add following class and see how it solves the issues:
Do you want to import csv or excel (xls, xlsx) file in MongoDB? You can read the file, get the data in C# datatable and save it to MongoDB using InsertBatch method. This article explains how to save C# DataTable to MongoDB for inserting a large amount of data.
To install Official .NET driver for MongoDB, run the following command in the Package Manager Console
To read CSV file doesn’t mean to use String.Split(). CSV files may contain commas, carriage returns, speechmarks…etc within strings. In this post, we will learn how to upload and read CSV File in ASP.NET MVC WITHOUT using Jet/ACE OLEDB provider. It is helpful when you have to deploy your code on shared hosting, Azure website or any server where ACE Database engine is not available. We will use a fast CSV Reader by Sebastien Lorien.
Read Also: Upload and Read Excel File (.xls, .xlsx) in ASP.NET MVC.