Skip to main content

Posts

Showing posts from 2019

Download File Angular 8 And ASP.NET Web API 2

Web API Code : [Route("DownloadFile")]         [HttpGet]         public HttpResponseMessage DownloadFile(string filePath)         {             HttpResponseMessage Response;             //string RootPath = HttpContext.Current.Server.MapPath("~/Upload/");             string FilePath = HttpContext.Current.Server.MapPath(filePath);             if (File.Exists(FilePath) == false)             {                 Response = Request.CreateResponse(HttpStatusCode.NotFound, "File does not exist.");             }             else             {                 // Serve the file to the client     ...

Fastest way of pagination SQL Query

string sql=string.Format(@"DECLARE @skipRows int = {0},                                               @takeRows int = {1},                                               @count int = 0                                               ;WITH Message_cte AS (                                               SELECT M.*,O.OrderNo AS WebOrderNo,O.OrderDate FROM [Message] M                                               INNER JOIN...