My Name Is Salman Masood , I am Computer Science &Amp; Maths Graduate from University of Karachi, Pakistan , Teaching Is My Passion and My Aim Is to Deliver All My Knowledge among Those Students Who Can'T Afford Tutors or Expensive Institute Fees. I Will Be Keep Sharing My All Knowledge and Information with You .... Remember Me in Your Prayers !
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";
}
}
image and jumbotron class in bootstrap
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>grid in bs</title>
<link type="text/css" rel="stylesheet" href="css/bootstrap.css"/>
<link type="text/css" rel="stylesheet" href="css/bootstrap.min.css"/>
<link type="text/css" rel="stylesheet" href="css/bootstrap-theme.css"/>
<link type="text/css" rel="stylesheet" href="css/bootstrap-theme.min.css"/>
<style>
body
{ background-color:#000;
}
#SIDE a:hover
{ background-color:#09F;
color:#fff;
font-family:"Courier New", Courier, monospace;
font-size:26px;
}
</style>
</head>
<body>
<div class="container" style="height:1000px; background-color:#069">
<div class="row" style="height:200px; background-color:#096;background-image:url(img/1.jpg); background-size:100% 1000px">
<div class="col-sm-4" style="height:200px; ">
<img src="img/logo (1).png" style="width:80%;height:200px"/>
</div>
<div class="col-sm-4" style="height:200px; "> </div>
<div class="col-sm-4" style="height:200px; ">
</div>
</div>
<!-- HEad section end.............................................. -->
<div class="row" style="height:50px; background-color:#036">
</div>
<DIV class="row" style=" height:1000px; background-color:#CCC">
<div ID="SIDE" style="height:1000px;background-image:url(img/1.jpg); background-size:100% 1000px" class="col-sm-2">
<h3>ASIDE BAR </h3>
<nav>
<ul class="nav nav-pills nav-stacked">
<li class="active"> <a href="#" >Home </a> </li>
<li> <a href="#">About Us </a> </li>
<li> <a href="#">Gallery </a> </li>
<li> <a href="#">Contact Us </a> </li>
<li> <a href="#">Admission </a> </li>
<li> <a href="#">Home </a> </li>
<li> <a href="#">About Us </a> </li>
<li> <a href="#">Gallery </a> </li>
<li> <a href="#">Contact Us </a> </li>
<li> <a href="#">Admission </a> </li>
</ul>
</nav>
</div>
<div style="background-color:white;height:1000px;background-image:url(img/2.jpg); background-size:100% 1000px" class="col-sm-8">
<div style="width:100%; background-color:rgba(82, 99, 158,0.4)">
<div class="jumbotron" >
<h1>Bootstrap Tutorial </h1>
<p>Bootstrap is the most popular HTML, CSS, and JS framework for developing responsive, mobile-first projects on the web. </p>
</div>
</div>
<table style="margin-left:90px">
<tr>
<td>
<img src="img/slide1.jpg" style="width:150px; height:100px; display:inline" class="img-responsive img-circle" />
</td>
<td>
<img src="img/slide2.jpg" style="width:150px; height:100px; display:inline" class="img-responsive img-circle" />
</td>
<td>
<img src="img/slide3.jpg" style="width:150px; height:100px; display:inline" class="img-responsive img-circle" />
</td>
</tr>
<tr>
<td>
<img src="img/slide2.jpg" style="width:150px; height:100px; display:inline" class="img-responsive img-circle" />
</td>
<td>
<img src="img/slide3.jpg" style="width:150px; height:100px; display:inline" class="img-responsive img-circle" />
</td>
<td>
<img src="img/slide1.jpg" style="width:150px; height:100px; display:inline" class="img-responsive img-circle" />
</td>
</tr>
<tr>
<td>
<img src="img/slide1.jpg" style="width:150px; height:100px; display:inline" class="img-responsive img-circle" />
</td>
<td>
<img src="img/slide2.jpg" style="width:150px; height:100px; display:inline" class="img-responsive img-circle" />
</td>
<td>
<img src="img/slide3.jpg" style="width:150px; height:100px; display:inline" class="img-responsive img-circle" />
</td>
</tr>
</table>
</div>
<div style="background-color:#C03;height:1000px; background-image:url(img/1.jpg); background-size:100% 1000px" class="col-sm-2"> </div>
</DIV>
</div>
<!-- CONTAINER end.............................................. -->
<script src="js/bootstrap.js"> </script>
<script src="js/bootstrap.min.js"> </script>
<script src="js/jquery.js"> </script>
<script src="js/jquery-migrate-1.4.1.min.js"> </script>
</body>
</html>
Thursday, 26 October 2017
Complete Guide of store procedure with return and output parameters in ...
create database employee
use employee
create table tblemployee
(
id int primary key identity,
name nvarchar(20),
gender nvarchar(20),
dept_id int
)
insert into tblemployee values('salman','male',201)
insert into tblemployee values('raza','male',241)
insert into tblemployee values('ali','male',241)
insert into tblemployee values('sana','female',601)
insert into tblemployee values('sami','male',101)
insert into tblemployee values('test','female',201)
select * from tblemployee
create proc insert_tblemp
(
@name nvarchar(20),
@gender nvarchar(20),
@dept_id int,
@NewId int output
)
as
begin
insert into tblemployee values(@name,@gender,@dept_id)
Select @NewId = SCOPE_IDENTITY()
end
declare @id int
execute insert_tblemp 'umar','male',231,@id out
print @id
---------------------------------------------------------
Create Procedure spGetTotalCountOfEmployees1
@TotalCount int output
as
Begin
Select @TotalCount = COUNT(ID) from tblEmployee
End
Declare @TotalEmployees int
Execute spGetTotalCountOfEmployees1 @TotalEmployees Output
Select @TotalEmployees
------------------------------------------------------------
Create Procedure spGetTotalCountOfEmployees2
as
Begin
return (Select COUNT(ID) from tblemployee)
End
Declare @TotalEmployees int
Execute @TotalEmployees = spGetTotalCountOfEmployees2
Select @TotalEmployees
----------------------------------------------------------
select * from tblemployee
Create Procedure spGetNameById0
@Id int,
@Name nvarchar(20) Output
as
Begin
Select @Name = Name from tblemployee Where Id = @Id
End
Declare @EmployeeName nvarchar(20)
Execute spGetNameById0 1, @EmployeeName out
Print 'Name of the Employee = ' + @EmployeeName
Create Procedure spGetNameById01
@Id int
as
Begin
Return (Select Name from tblEmployee Where Id = @Id )
End
Declare @EmployeeName nvarchar(20)
Execute @EmployeeName = spGetNameById01 1
Print 'Name of the Employee = ' + @EmployeeName
Wednesday, 25 October 2017
create animation using js
html code:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>space</title>
<style>
body
{ margin:0 auto;
padding:0px;
}
#wrapper
{
height:900px;
background-image:url(img/maxresdefault.jpg);
background-size:100% 900px;
}
</style>
</head>
<body>
<div id="wrapper">
<img src="img/1.png" style="margin-left:300px; margin-top:150px;" id="st" onMouseOver="runcomplete()"/>
</div>
<script src="js/js.js"> </script>
</body>
</html>
javascript code:
// JavaScript Document
A=new Array("img/2.png","img/3.png","img/1.png");
function a()
{ document.getElementById('st').src=A[0];
}
function b()
{ document.getElementById('st').src=A[1];
}
function c()
{
document.getElementById('st').src=A[2];
}
function runcomplete()
{
setTimeout(a,500);
setTimeout(b,1000);
setTimeout(c,1500);
setTimeout(a,2000);
setTimeout(b,2500);
setTimeout(c,3000);
}
Subscribe to:
Posts (Atom)
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 ...
-
Load event: pictureBox3.Image = Image .FromFile( @"C:\Users\salman\Documents\Visual Studio 2013\Projects\WindowsFormsApplication3\W...