Posts

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,    

How to Install GIT ?

Image
In this blog post we are going see the installation steps for  git on windows O.S Following are the steps required to install the GIT on Windows O.S.  1) Open the following link in any browser https://git-scm.com/download/win Download will start automatically , if it does not start click on "click here to download manually"  hyperlink.     2) Once Download is complete click on .exe file.  3) Click on Run if the security warning window pops up.   4) Follow through the default installation process until you get to “Choosing the default editor used by Git”. The default “Use Vim” may be too complex to use, if you are not familiar with Vim. Choose Nano or Notepad++ or visualstudiocode which is easier to use.   5) Choose “Use Git from the Windows Command Prompt”.   6) In "Choosing HTTPS transport backend" window leave the default option selected, then click on next.   7) In "Configuring the line ending conversio

ASP.NET WEB API Programming

Image
ASP.NET WEB API. In this blog post we will see a sample example to quick start ASP.NET WEB API Programming. Before starting we will understand few important questions about the existence of the ASP.NET Web API. Question 1 : Is ASP.NET WEB API is replacement of WCF ? No,Web API has not replaced existing web service technology called WCF, but it's way different from WCF, where WCF follows SOAP based message formatting and Web API services  are non-SOAP based and returns plain XML or JSON string etc. Web API transport data over network using HTTP Protocal unlike WCF.  WCF uses different protocols for transferring data over HTTP, TCP, MSMQ, Named pipes.etc.   Question 2 :  ASP.NET Web API vs  WCF RESTful Service  ? Both  ASP.NET Web API and  WCF REST follows the REST principle but having following differences: ASP.NET Web API Web API supports full features of HTTP 

Introduction to ASP.NET WEB API

Image
What is ASP.NET WEB API ? WEB API is a framework for building HTTP services that can be accessed across wide range of devices and platforms including browsers, mobile devices,IOT(Internet of things) devices, desktop devices and cross platforms.  It is perfect for building restful services.though It can be used to create services which are not restful. Web API is very much similar to ASP.Net MVC pattern as it contains MVC like features model, controllers, action results, routing and filters .  Web API as the name suggests, is an API over the web which can be accessed using HTTP protocol. ASP .Net Web API is an add on to the ASP.Net Framework. and web api actions(methods) are requested by HTTP verbs(GET,POST,PUT,DELETE). What is API ? API : API stands for Application Program Interface, which has tools and protocols to develop software applications. What is Restful ? RE presentational S tate T ransfer (REST) is an architectural style that has a set of configur