SPA stands for Single Page Application. Here I will demonstrate a simple SPA with ASP.NET MVC, Web API and Entity Framework. I will show a trainer profile and its CRUD operation using AngularJS, ASP.NET MVC, Web api and Entity Framework. Step 1: Create a ASP.NET MVC application with empty template Open visual studio, Got to
Tag: C
Install and uninstall windows service from command prompt
Suppose you have created a windows service name “YourServiceName.exe”. Now you want to install or uninstall it from command prompt. To Install Service run the commnad: C:\Windown\Microsoft.Net\framework\v2.0\installUtil.exe C:\dirctory\YourServeceName.exe (with location) To Uninstall Service run the command: C:\Windown\Microsoft.Net\v2.0\installUtil.exe /u C:\dirctory\YourServeceName.exe (with location)
Introduction to Web services with ASP.NET
What is Web Services? Web service is a method of communication between two web based application using XML, SOAP, WSDL and UDDI open standards over an internet protocol backbone. Web service can convert your application into web application which can publish its function or message to the rest of the world). Web service are- Web
A Simple Demonstration with ASP.net GridView
GridView is a powerful control of ASP.net. Here I tried to demonstrate gridview with a simple project. I have stored employee information then displayed it in gridview and insert, update and delete employee information. Step 1: Create a table name hrm_employee and insert some sample data in it. –Create Table : hrm_employee— CREATE TABLE hrm_employee
Open Close Principle with C#
Open Close Principle is an Object Oriented Design principle. It is first introduced by Betrand Meyer in 1988. He says “Software entities (Class, module, function etc.) should be open for extension, but closed for modification”. An entity is “Open for extension” means that its behavior can be extended to accommodate new demand. The entity is
Singleton Design Pattern with C#
Design Pattern Design pattern is a solution of known problems. These are strategies of solving commonly occurring problems. A design pattern is not a finish design. It is like a template to solve a problem. Singleton Design Pattern Singleton is a software design pattern. It is restrict to create object more than once. This is
Padding character with string
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Padding { class Program { static void Main(string[] args) { string str = “This is a text”; char padChar = ‘.’; Console.WriteLine(str.PadLeft(25, padChar)); Console.WriteLine(str.PadLeft(2, padChar)); Console.WriteLine(str.PadRight(25, padChar)); Console.WriteLine(str.PadRight(2, padChar)); str = “I am Mahedee hasan. Software Architect, Leadsoft Bangladesh Ltd”; Console.WriteLine((str.PadRight(25, padChar))); Console.WriteLine((str.PadRight(25,padChar)).Substring(0,24)+”…”); Console.ReadKey();
Iterator Design Pattern with C#
Iterator pattern is a design pattern which is used to traverse aggregate object often called container and access container’s object without exposing it’s underlying representation. Iterator pattern decoupled algorithm from aggregate object or container. In some cases, algorithms are container specific. We often use collection in C# and then we traverse the collection without knowing
Training on C# for beginner
C# – Part 1 from Mahedee Hasan
How to send email in ASP.net
ou have to configure SMTP server before sending email from your server. Hope you already know how to configure smtp server. Here is the simple code segment for sending email against a button click. protected void btnSendMail_Click(object sender, EventArgs e) { SmtpClient smtpClient = new SmtpClient(); MailAddress fromAddress = new MailAddress(“mahedee_hasan@leads-bd.com”); //Sender email address MailMessage
Calculate file checksum using c#
Calculate file checksum using c# using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Security.Cryptography; using System.Text; using System.Threading.Tasks; namespace CheckSumTest { class Program { static void Main(string[] args) { string filePath = @”G:\Mahedee_Share\Created\23062014-1\FileDeployManager\FileDeployManager\Form1.cs”; string checksumMd5 = GetFileChecksum(filePath, Algorithms.MD5); string checksumSha1 = GetFileChecksum(filePath, Algorithms.SHA1); string checksumSha256 = GetFileChecksum(filePath, Algorithms.SHA256); string checksumSha384 = GetFileChecksum(filePath, Algorithms.SHA384); string
Strategy Design Pattern with C#
Strategy design pattern is a behavioral design pattern. It is a particular software design pattern where algorithms are selected at runtime. According to the book of Design Pattern (Gang of Four) – “Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it.
Abstract Factory Pattern with C#
Abstract factory pattern is a creational design pattern. Creational design pattern is deals with object creation mechanism. Object creation mechanism is changed on the basis of problem. Abstract factory pattern provides an interface to create families of related or dependent objects without specifying their concrete class. It is identified on the basis of problem complexity.
Generate image on the fly by ASP.NET
Generating image on the fly is not difficult in asp.net. Here I have created national flag of Bangladesh on the fly and displayed this as JPEG image format in asp.net web form. So let’s start to draw an image on the fly. Step 1: Add a new web form in ASP.net website. Step 2: In
Factory Design Pattern with C#
Factory design pattern implements the concept of real world factories. Factory pattern is a creational design pattern. It deals with creating object without specifying exact class. In general, actors of factory patterns are a client, a factory and a product. Client is an object that requires another object for some purposes. Rather than creating the