Tuesday, 14 November 2017

5- Variables in JavaScript (Diffrence b/w strongly type and loosely type...





—<!DOCTYPE
html>
—<html>
—<body>
—  <h1>Demo: JavaScript Variables
</h1>
— 
—  <p id="p1"></p>
—
—  <script>
—  var
one =1;  // number value
—
—  one= 1.1; // 
decimal value
— 
—  one = true; // Boolean value
— 
—  one = null; // null value
— 
—  one = 'one'; // string value
—
—
—  document.getElementById("p1").innerHTML
= one;
—    </script>
—</body>


—</html>

Monday, 13 November 2017

Learn Sql server in hindi/urdu part-4 (Alter Table ,Update Table and Whi...





alter table student



add dateofadmission date





select * from student



update student

set dateofadmission='11/14/2016'

where id in (2,4)







Declare @Number int



Set @Number = 1008

While(@Number <= 1010)

Begin



 update student

set dateofadmission='11/11/2016'

where id =@Number





 Set @Number = @Number + 1





End







insert into student(name,batchcode,contactnumber,dateofadmission)

values('xyz','14b2v1','090078601',GETDATE())





select * from student




Learn Sql server in hindi/urdu part-4 (Not Operator and Order By Clause)





select * from student --display all data



select  id,name,contactnumber from student --display selected column



select * from student where batchcode='1208c1' -- where clause with one column



select * from student where name='emad' and batchcode='1708c1' and id=1003 --where clause with and operator



select * from student where batchcode='1708c1' or batchcode='120c1'



select * from student order by name  desc



select * from student order by name  asc



select * from student order by id desc



select * from student where batchcode!='1707b1' and batchcode!='1610c1'





select * from student where batchcode!='1707b1' or batchcode!='1610c1'





select * from student where batchcode not in ('1707b1','1610c1','1502c1')



select * from student where id not in (1002,1003,1004,2,4)


Friday, 10 November 2017

Learn Sql server in hindi/urdu part-2 (Constraints ,not null ,unique, id...







create database sql1707b1



use sql1707b1







create table student

(



id int primary key identity,

name nvarchar(20) not null,

batchcode nvarchar(20) not null,

contactnumber nvarchar(20) not null unique



)









insert into student (name,batchcode,contactnumber)

values('safeer','1707b1','03425321680')





insert into student (name,batchcode,contactnumber)

values('naseer','1707b1','03415321680')







delete from student --deleting record..........

drop table student





select * from student





select * from student where id=1


Learn Sql server in hindi part-1 (create database,use database,create ta...











create database sql1707b1



use sql1707b1







create table student

(

id int,

name nvarchar(20),

batchcode nvarchar(20),

contactnumber nvarchar(20)



)



select * from student



insert into student (id,name,batchcode,contactnumber)

values(1,'sahil','1707b1','03425321680')



insert into student (id,name,batchcode,contactnumber)

values(2,'Hammad','1707b1','03424323680')



insert into student (id,name,batchcode,contactnumber)

values(3,'AbuZar','1707b1','03413325581')




Saturday, 28 October 2017

Anonymous method in C# Complete Guide from basic

example -1

 class Program
    {
        public delegate void Print(int value);
        static void Main(string[] args)
        {
            Print print = delegate(int val)
            {
                Console.WriteLine("Inside Anonymous method. Value: {0}", val);
            };

            print(100);
            print(2000);

            Console.ReadLine();
        }




    }

example -2

 class Program
    {
        public delegate void Print(int value);
        static void Main(string[] args)
        {
            int i = 10;

            Print prnt = delegate(int val)
            {
               // val += i;
                val = val + i;
                Console.WriteLine("Anonymous method: {0}", val);
            };

            prnt(100);

            Console.ReadLine();
        }
    }

example -3


  class Program
    {
        public delegate void Print(int value);
   
        static void Main(string[] args)
        {
            PrintHelperMethod(delegate(int val) 
            {
                Console.WriteLine("Anonymous method: {0}", val); 
            }, 100);

            Console.ReadLine();


        }

        public static void PrintHelperMethod(Print printDel, int val)
        {
            val += 10;
            printDel(val);
        }
    }

Friday, 27 October 2017

From Validation in JavaScript with html and Css Complete Tutorial From Basic

Html code:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Form Validation</title>

<link href="css/style.css" rel="stylesheet" type="text/css"/>
</head>

<body>
<div id="wrapper"> 




<div id="formbox">

<table> 


<tr>  <td style="width:30px">Email </td>   <td> <input type="text" id="email" onChange="checkemail()" style="border-radius:20px 20px 20px 20px;height:35px;width:200px"/> </td>  <td> <span id="emailerror"> </span>  </td>  </tr>


<tr>  <td>Password </td>   <td> <input type="password"  id="pwd" onChange="checkPASSWORDLENGTH()" style="border-radius:20px 20px 20px 20px;height:35px;width:200px"/> </td>  <td> <span id="pwderror"> </span>  </td>  </tr>



<tr>  <td>Confirm Password </td>   <td> <input type="password" id="cpwd" onChange="confrimpassword()"  style="border-radius:20px 20px 20px 20px;height:35px;width:200px"/> </td>  <td> <span id="cpwderror"> </span>  </td>  </tr>

<tr>   
 <td>


 </td> 
 <td>
<button> Submit!</button>

 </td> 
 
 
  </tr>



</table>


 </div>






</div>

<script src="js/js.js"> </script>


</body>
</html>

css code:

@charset "utf-8";
/* CSS Document */
body
{ margin:0 auto;
padding:0px;

}

#wrapper
{ width:100%;
height:1000px;
background-image:url(../img/login.jpg);
background-size:100% 1000px;

}
#formbox
{ width:500px;
height:300px;
background-color:rgba(243, 242, 242,0.4); 
position:absolute;
 margin-left:300px;
 margin-top:300px; 



}
td
{ padding:15px;
}

Js code:

// JavaScript Document

function checkemail()
{
var c=document.getElementById("email").value;
var pos=c.search("@");
if(pos==-1)
{
document.getElementById("emailerror").innerHTML="Invalid Email Id";
document.getElementById("emailerror").style.color="red";
}
else
{
var domainname=c.substring(pos+1); 

var d= domainname.toLowerCase();

if(d!=="yahoo.com")
{
document.getElementById("emailerror").innerHTML="use correct domain name like yahoo.com";
document.getElementById("emailerror").style.color="red";

}
else
{
document.getElementById("emailerror").innerHTML="valid Email Id";
document.getElementById("emailerror").style.color="green";
}


}



}







function checkPASSWORDLENGTH()
{
var c=document.getElementById("pwd").value;
var l=c.length;
if(l<8 || l>15)
{
document.getElementById("pwderror").innerHTML="Password should contain atleast 8 characters!";
document.getElementById("pwderror").style.color="red";
}

else
{
document.getElementById("pwderror").innerHTML="valid Password ";
document.getElementById("pwderror").style.color="green";
}
}







function confrimpassword()
{

var pwd=document.getElementById("pwd").value;
var cpwd=document.getElementById("cpwd").value;

if(pwd!==cpwd)
{
document.getElementById("cpwderror").innerHTML="Password Mismatch";
document.getElementById("cpwderror").style.color="red";
}
else
{
document.getElementById("cpwderror").innerHTML="Password match";
document.getElementById("cpwderror").style.color="green";

}


}


Pass Dynamically Added Html Table Records List To Controller In Asp.net MVC

Controller Code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ...