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);

}









Delegates in c#





using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;



namespace deletegate_salman

{

    class Program

    {

        public delegate void print(int num);

        static void Main(string[] args)

        {

            print p = printsalary;

            p(50000);

            p(450000);



            p = printeMPLOYEEID;

            p(50000);

            p(450000);





            Console.ReadLine();

        }



        public static void printsalary(int s)

        {

            Console.WriteLine("salary is :"+s);

        }





        public static void printeMPLOYEEID(int s)

        {

            Console.WriteLine("EmploeeId is :" + s);

        }











    }

}


Monday, 23 October 2017

How to make tables and images responsive (IMAGE AND TALBES 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"/>

</head>



<body>



<div class="container" style="height:1000px; background-color:#069">



<div class="row" style="height:200px; background-color:#096">



<div class="col-sm-4" style="height:200px; background-color:red">

<img src="img/logo.png" style="width:200px; height:200px;" class="img-responsive img-thumbnail"/>



 </div>



<div class="col-sm-4" style="height:200px; background-color:green"> </div>



<div class="col-sm-4" style="height:200px; background-color:yellow">

<img src="img/changeimg.jpg" style="width:200px; height:200px;" class="img-responsive  img-rounded"/>

</div>





</div>



<!-- HEad section end..............................................  -->

<div class="row" style="height:50px; background-color:#096">



</div>





<DIV class="row" style=" height:500px; background-color:#CCC">



<div style="background-color:#03C;height:500px" class="col-sm-3"> </div>



<div style="background-color:white;height:500px" class="col-sm-6">



<h1 >Bootstrap Tutorials <small> Tables </small> </h1>



<table class="table table-striped table-bordered table-hover table-responsive">



<tr> <td><b> Id</b> </td>  <td><b> Name</b> </td> <td><b> Email </td> </tr>





<tr> <td> 1</td>  <td> Salmanmasood</td> <td>theideassolution@gmail.com</td> </tr>





<tr> <td> 2</td>  <td> Ali</td> <td>Alisolution@gmail.com</td> </tr>







<tr> <td> 3</td>  <td> Umar</td> <td>Umardeassolution@gmail.com</td> </tr>











</table>







</div>





<div style="background-color:#C03;height:500px" class="col-sm-3"> </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>


How to break page sections without css (grids 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"/>
</head>

<body>

<div class="container" style="height:1000px; background-color:#069">

<div class="row" style="height:200px; background-color:#096">

<div class="col-sm-4" style="height:200px; background-color:red">


 </div>

<div class="col-sm-4" style="height:200px; background-color:green"> </div>

<div class="col-sm-4" style="height:200px; background-color:yellow">

</div>


</div>

<!-- HEad section end..............................................  -->
<div class="row" style="height:50px; background-color:#096">

</div>


<DIV class="row" style=" height:500px; background-color:#CCC">

<div style="background-color:#03C;height:500px" class="col-sm-3"> </div>

<div style="background-color:white;height:500px" class="col-sm-6">





</div>


<div style="background-color:#C03;height:500px" class="col-sm-3"> </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>

Friday, 20 October 2017

How to Make FaceBook login Page using Bootstrap (part 2/2)




<!doctype html>

<html>

<head>



<title>Facebook.com</title>

<meta charset="utf-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1">

    <meta name="description" content="">

    <meta name="author" content="">



<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-grid.css"/>

<link type="text/css" rel="stylesheet" href="css/bootstrap-reboot.css"/>

<link type="text/css" rel="stylesheet" href="css/bootstrap-reboot.min.css"/>

<link type="text/css" rel="stylesheet" href="css/bootstrap-grid.min.css"/>





<link rel="shortcut icon" href="img/icon.png">





<style>



td{

padding:8px;

}



</style>





</head>



<body>









<div class="row" style="background-color:#000;height:100px;">



<div class="col-md-6" style="height:100px; background-color:rgb(47,69,117)">



<img src="img/logo.png" style="width:200px; height:60px;margin-left:100px; margin-top:20px;"/>



 </div>



<div class="col-md-6" style="height:100px;  background-color:rgb(47,69,117">



<div class="row">

<div class="col-4">



<p style="color:white;">Email</p>

<input type="text"/><br>

<span style="color:white;"><input type="checkbox"/>Keep Me log In </span>



</div>







<div class="col-4" style="margin-left:20px;">



<p style="color:white;">Password</p>

<input type="password"/><br>

<span style="color:white;">Forgotten Password? </span>





</div>





</div>



 </div>

















</div>







<div class="row" style="background-color:blue;height:900px;">



<div class="col-md-7" style="background-color:rgb(226,230,241);height:900px">



<img src="img/facebook-connecting-people.jpg" style="width:100%; height:400px; margin-top:50px"/>





 </div>



<div class="col-md-5" style="height:900px;background-color:rgb(227,229,241)">



<h1> Create an Account</h1>

<br>

<h3> It's Free and always will be</h3>

<form style="margin:0 auto;width:90%;"> 



<table>



<tr>



<td style="width:50%"> <input type="text" placeholder="First Name" class="form-control"/ ></td>

<td style="width:50%"> <input type="text" placeholder="last Name" class="form-control"/ ></td>



 </tr>





 <tr> <td colspan="2"> <input type="text" placeholder="Email" class="form-control"/ ></td>

</tr>





 <tr> <td colspan="2"> <input type="text" placeholder="Re-Enter Email" class="form-control"/ ></td>

</tr>



 <tr> <td colspan="2"> <input type="password" placeholder="Password" class="form-control"/ ></td>

</tr>



 <tr> <td > <input type="password" placeholder="yy-mm-dd" class="form-control"/ ></td>

</tr>



<tr>

<td>

<span style="font-size:24px;color:#06F"> <input type="radio" >Male </span>



<span style="font-size:24px;color:#06F"><input type="radio">Female</span>

</td>

 </tr>





 <tr> <td><p>To make your document look professionally produced, Word provides header, footer, cover  </p> </td> </tr>





 <tr> <td> <button class="btn btn-lg btn-success" > Create An Account</button> </td> </tr>



</table>







</form>





</div>







</div>















































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



</script>



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



</script>





</body>



</html>

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 ...