Posts

Showing posts from 2020

Download Excel File using AJAX in JavaScript

Image
Hello Guys, In this blog post we are going to see how we can download an excel file using a javascript function. I have added a HTML button on the page, When we click on HTML button, the javaScript function is called and  the file name is passed as parameter to the javascript function.  We will use  XMLHttpRequest object to get the file data in binary format. The onload event handler of the  XMLHttpRequest object  will convert the received Byte Array (Binary Data) into BLOB (Binary Large Object) object and the file is downloaded in the browser. Create an empty .NET web application and add HTML page provide a name to the HTML file and add a sample excel file to the root of the application. Below is the complete HTML code. <!DOCTYPE html> <html> <head>     <meta charset="utf-8" />     <title></title> </head> <body>     <input type="button" value="Download Excel File" onclick="DownloadFile('Sample

How to Capture Image using web camera in Asp.net and C#.NET / VB.NET

Image
Hello Guys, In this blog post we are going to learn how to capture an image using web camera in .NET Web Application using Asp.net and C#.NET / VB.NET  In order to capture image using Web Camera (webcam) we are going to use Webcam.js Javascript library.  Install the webcam.js file from below location and copy to your javascript folder inside your application.  Download jQuery Webcam Plugin   Copy below code in your ASPX view page <div class="container">                 <div class="row">                     <div class="col-md-6 col-xl">                         <label>Capture Image</label>                     </div>                     <div class="col-md-6 col-xl">                         <label>Upload Image</label>                     </div>                 </div>                 <div class="row">                     <div class="col-md-6 col-xl">  

Difference between Asp.net and Asp.net Core

 Let’s understand the .NET Core before exploring the differences between ASP.NET and ASP.NET Core. Open source framework maintained by Microsoft.   It implements .NET standard specifications. .Net Framework only runs on windows. .NET Core applications can run on windows, macOS and Linux, Whereas .NET Framework is older runtime which existed in windows for many years.  Let’s understand the  ASP.NET Core features Can build and run  ASP.NET  applications on operations system like windows,mac,linux..etc. ASP.NET core unifies MVC and Web API. Can host on IIS or self host on own process. Built in dependency injection support. Easy integration with client side frameworks like angular or react or knockout. Provides environment based configuration system. Light weight and moduler HTTP request pipe line. Supports side by side app versioning. Can be downloaded as nuget package. Difference between ASP.NET and ASP.NET Core ASP.NET 4.x ASP.NET Core Build for Win

How to convert XML String to DataTable in Sql Server

DECLARE @CategoryLevel varchar(max) SET @CategoryLevel = '<DocumentElement>   <CategoryLevel>     <Mapping_ID>0</Mapping_ID>     <Level_ID>1</Level_ID>     <Level_Description>LEVEL1</Level_Description>     <Level_Score>10</Level_Score>     <IsChecked>true</IsChecked>   </CategoryLevel>   <CategoryLevel>     <Mapping_ID>0</Mapping_ID>     <Level_ID>2</Level_ID>     <Level_Description>LEVEL2</Level_Description>     <Level_Score>30</Level_Score>     <IsChecked>true</IsChecked>   </CategoryLevel> </DocumentElement>'  DECLARE @handle INT  DECLARE @PrepareXmlStatus INT  EXEC @PrepareXmlStatus= sp_xml_preparedocument @handle OUTPUT, @CategoryLevel  DECLARE @TblLevel as table(Mapping_ID BIGINT,     Level_ID BIGINT,     Level_Description NVARCHAR(256),     Level_Score INT,