Posts

Image
COOKIE IN ASP.NET CORE Below sample C# code demonstrated on how to create and set cookie in ASP.NET  Core A cookie is a client-side state management technique which use to store a small amount of data on client  browser There are 2 types of Cookies. Persistence :- Persistence Cookies are stored according to the time span mentioned by user Non-Persistence :- Non-Persistence Cookies get expires when you close your browser. We are going to see a short demo of how to create a cookie and read the view from the cookie in ASP.NET Core. I have added Home Controller with name and Create ActionMethod in it. In creating action method, we are going to create a cookie with name “ DemoCookie ” and we are going to set an expiration for a week and to add a cookie to the browser we are going to call  Response.Cookies.Append().  public IActionResult Create()         {             string key = "DemoCookie";             string value = "Yogesh";             CookieOptions options = new C

How to add a new SSH key to your GitHub account

Image
 there could be scenario when you change your username on github account and you are not able to clone any of your exiting repositiory into your local machine either you will face . Fatal: Could not read from remote repository Please make sure you have the correct access rights and the repository exists  or error could be differnt like  git@github.com : Permission denied (publickey). fatal: Could not read from remote repository. in that case you have to generate new SSH key on your local machine and need to add same key into your github account . prerequisite :-  Download Git Bash from the below link based on your operating system and install it on your local system.   https://git-scm.com/downloads step 1 open cmd / Git bash  step 2 use this command to generate SSH key on your local system  ssh-keygen -t rsa -b 4096 -C "youremail@gmail.com" When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location. step

How to Integrate SB Admin 2 Template in Asp.net Mvc Application

Image
Template URL    https://startbootstrap.com/themes/sb-admin-2/ Step1 : Download Template form above URL open template copy files /folder from  CSS , JS,Vendor Folder from template  Step 2 : Create Asp.net Mvc Application Open content Folder and paste above Item into folder   Step 3: Open Index.html from template and copy content from Index.html after that open Home controller and Index .cshtml file and paste code inside Index. cshtml replace reference of file as below screen (~/Content) that we have copied Inside content folder   Step 4 : Layout should be null for this Action Method   Step 5 : Run the Application ...

Send mail when Rss news is published using Logic Apps - Azure portal

Image
Basically Logic App is use to Automate the process  Today we are going to demonstrate How to Send Mail(gmail) using Logic App when new Item or news feed is published step 1 :- Create Logic App using Azure Portal , give any meaningful name to the logic App  step 2 :- step 3 :- click on create and after that when app get published click on Go To Resources and go inside newly created Logic App and click on Blank Logic App step 4:- click on RSS  and Search for action like when a feed item is published after that provide  url  :-  http://feeds.reuters.com/reuters/topNews  and click on next step step 5 :- Add Gmail account add necessary details and allow access to use logic app  and select action send mail  step 6 :-  click on the save Button and Run the Logic App step 7 :- Go to gmail and check after sometime  step 8 :- Go to Azure portal inside logic app check summery of mail and after that go to overview and disab

Create Azure Table Storage using console Application

Image
Create a C# Console Application using Visual Studio   Install  Below DLL Using Nuget Package WindowsAzure.Storage Microsoft.WindowsAzure.ConfigurationManager Inside of your Console app, you will see  App.config , now add the following section: <appSettings> <add key="StorageConnection" value="YOUR-CONNECTION-STRING-COPIED-FROM-EARLIER"/> </appSettings> Copy the following code into your Main method:            CloudStorageAccount storageAccount = CloudStorageAccount.Parse(             CloudConfigurationManager.GetSetting("StorageConnection"));             CloudTableClient tableClient = storageAccount.CreateCloudTableClient();             // Name of table to be create             CloudTable table = tableClient.GetTableReference("AzureDemo");             table.CreateIfNotExists();             Console.ReadKey(); Run the Project  This code will get our connection string from the 

Retrieve Data From Multiple Tables Using Asp.Net MVC

Image
Today, in this article, we will see the step-by-step process of joining multiple tables using LINQ Join and displaying records in a View. So, let's start. Step 1 Open SQL server and create a database and 3 tables. I have created three tables as - Employee, Department, and Incentive respectively. Employee Table CREATE TABLE [dbo].[Employee](     [EmployeeId] [int] IDENTITY(1,1) NOT NULL,     [Name] [nvarchar](50) NULL,     [Gender] [char](10) NULL,     [Age] [int] NULL,     [Position] [nvarchar](50) NULL,     [Salary] [int] NULL,     [HireDate] [datetime] NULL,     [Department_Id] [int] NULL,     [Incentive_Id] [int] NULL,     CONSTRAINT [PK_Employee] PRIMARY KEY CLUSTERED      (         [EmployeeId] ASC     )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]     ) ON [PRIMARY]          GO    Department Table CREATE TABLE [dbo].[Department](    

How To Upload Multiple Images /Files into Database Using Angular web Api

Image
Introduction  In this article, I am going to explain how to upload multiple images using angular 8 and Web API, This article will help beginners who are getting started with Angular. Prerequisites Angular 8 Web API SQL Server HTML/Bootstrap  Steps required Create a database and  tables in SQL Server Create a Web API using ASP.NET Web API Create a new project in Angular   Create Database using Sql server create   database  db_multiplefile Create Table using using below fileds Id ,ImageName, and remark  I Have Created Web Api Project using Visual studio 2019 Now Create Edmx for Dababase Operations  Now Create a Empty controller I Have Created Controller name  FileUploadController I am sharing all code that I have written for controller  using FilesUpload.Models; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; using System.Net.Http; using System.Web.Http;