Posts

Simple CRUD Operation Web API

 Model --------------------------------------------------------- namespace ProjectWebApi.Model {     public class Brand     {         public int? Id { get; set; }          public string? BrandName { get; set; }     } } ------------------------- DbContext.cs ---------- using Microsoft.EntityFrameworkCore; namespace ProjectWebApi.Model {     public class BrandDbContext:DbContext     {         public BrandDbContext()         {         }         public BrandDbContext(DbContextOptions<BrandDbContext> options):base(options) {                                              }         public DbSet<Brand> Brands { get;set; }         internal voi...

Stored Procedure Tutorial

StudentID StudentName 2 Surya 3 Anil 4 Atulaya 5 Ananaya   Get Student with parameter --------------------------- create procedure GetStudent @StudentId int As begin select * from Students where StudentId=@StudentId end exec GetStudent 4 GetStudentWithNoParameter ---------------------------------- create procedure GetStudentNoParameter   As begin select * from Students   end exec GetStudentNoParameter exec GetStudent 2 UpdateStudent ------------------- create procedure UpdateStudent @StudentName varchar(400), @studentId int as begin update Students Set StudentName=@StudentName where StudentId=@studentId end EXEC UpdateStudent @StudentName = 'Anil', @studentId = 3 InsertStudent --------------------------------------- create procedure insertstudent @StudentName varchar(20) As begin insert into Students (StudentName) Values(@StudentName) end  exec insertstudent 'Ansh' Select * from Students Delete Student ------------------------------------------ create pr...

Code for Timer run on Website and Texbox validation only numeric are allowed.

 Validation for Text Box , Only numeric are allowed, ------------------------------------------------------------------------ function validation_Id(event) {             var key = event.keyCode || event.which;             var keychar = String.fromCharCode(key);             var pattern = /^[0-9]+$/;             if (key == 8 || key == 9 || key == 13 || key == 27 || key == 46 || (key >= 96 && key <= 105) ||                 (key >= 35 && key <= 40) || pattern.test(keychar) && !event.shiftKey) {                 // Allow backspace, tab, enter, escape, delete, arrow keys, and numeric input                 return true;             } else {               ...

Asp.net Core Web API Work -Get API

 Firt we create controller , using AutoMapper; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging;   using QOCR.IRepository.OcrMaster; using System; using System.Threading.Tasks; namespace QOCR.API.Controllers.OcrMaster {     //[Authorize]     [Route("api/[controller]")]     [ApiController]     public class StatusMasterController : ControllerBase     {         private IStatusMasterRepository _repos;         private readonly IMapper _mapper;         private readonly ILogger<StatusMasterController> _logger;         public StatusMasterController(IStatusMasterRepository repos, IMapper mapper, ILogger<StatusMasterController> logger)         {             _repos = repos;             _mapper = mapper;             _logger...

Reverse the array/string.

Image
  Given an array (or string), the task is to reverse the array/string. Examples :     Input : arr[] = {1, 2, 3} Output : arr[] = {3, 2, 1} Input : arr[] = {4, 5, 1, 2} Output : arr[] = {2, 1, 5, 4} 1) Initialize start and end indexes as start = 0, end = n-1  2) In a loop, swap arr[start] with arr[end] and change start and end as follows :  start = start +1, end = end – 1 Another example to reverse a string: Below is the implementation of the above approach :  // Iterative C# program to reverse an // array using System; class GFG { /* Function to reverse arr[] from start to end*/ static void rvereseArray(int []arr, int start, int end) { int temp; while (start < end) { temp = arr[start]; arr[start] = arr[end]; arr[end] = temp; start++; end--; } } /* Utility that prints out an array on a line */ static void printArray(int []arr, int size) { for (int i = 0; i < size; i++) Console.Write(arr[i] + "...

SMS Services by twilio and Ultra Message

 for reference  https://apps.quantumbso.com/ocnawcdev/frmLogin.aspx <html> <head></head> <title></title> <body> <h1>SMS Services by twilio and Ultra Message</h1> <h2>Code by Anil Dwivedi</h2> <p> First we login in Twilio account and get AccountSid and AuthToken form Twilio Account then  on button click we work on  here is my frmLogin.aspx page which is as per client requirement . <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="frmLogin.aspx.vb" Async="true" EnableEventValidation="false" Inherits="QflxDev.WorkFlow.frmLogin" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head>     <title id="Title"></title>     <link rel="stylesheet" id="CSSLink" />     <%=strCommonFunctionPath%>     <script type="text/javascript" src="Sup...