ASP.NET 6 Web API

Create New Project Template: ASP.NET Core Web API Framework: .NET 6.0 Check “Configure for HTTPS“ Check “Use controllers (uncheck to use minimal API)” for controller vs minimal API Check “Enable OpenAPI support” for Swagger OpenAPI support Book Class Book Controller or … For Delete, pass in object instead of id. BookController using Entity Framework Example:

Report Viewer Download

Microsoft Report Viewer 2015 Runtime https://www.microsoft.com/en-us/download/details.aspx?id=45496 Install Errors Microsoft System CLR Types for SQL Server 2014 is missing. Download Microsoft SQLSysCLRTypes from Official Microsoft Download Center

Convert DataTable to CSV Download

private void WriteDelimitedData(DataTable dt, string fileName, string delimiter) { //prepare the output stream Response.Clear(); Response.ContentType = "text/csv"; Response.AppendHeader("Content-Disposition", string.Format("attachment; filename={0}", fileName)); Response.ContentEncoding = System.Text.Encoding.UTF8; //write the csv column headers for (int i = 0; i < dt.Columns.Count; i++) { Response.Write(dt.Columns[i].ColumnName); Response.Write((i < dt.Columns.Count - 1) ? delimiter : Environment.NewLine); } //write the data foreach (DataRow... » read more