Wednesday 3 October 2012

Store Procedure for SQL Server Using C# and VB.Net

Store Procedure
Stored procedures can make managing your database and displaying information about that database much easier. Stored procedures are a recompiled collection of SQL statements and optional control-of-flow statements stored under a name and processed as a unit. Stored procedures are stored within a database, can be executed with one call from an application, and allow user-declared variables, conditional execution, and other powerful programming features.
Stored procedures can contain program flow, logic, and queries against the database. They can accept parameters, output parameters, return single or multiple result sets, and return values.
You can use stored procedures for any purpose for which you would use SQL statements, with these advantages:
You can execute a series of SQL statements in a single stored procedure.
You can reference other stored procedures from within your stored procedure, which can simplify a series of complex statements.
The stored procedure is compiled on the server when it is created, so it executes faster than individual SQL statements.
The functionality of a stored procedure is dependent on the features offered by your database. For more details about what a stored procedure can accomplish for you, see your database documentation.

Monday 1 October 2012

Random number Application in Java Script

Random number are number which make
a random sequence of numbers.In many appliaction we need random number
sequence,for example creating roll number between 1 to 10, in java script you can get random number using Math.random()
which return a floating point number less than zero.
You can get number within a range by multiplying. If you want
integer number then use can use parseInt function..

Create Random Number Between 1 to 10
         function ranNumber()
        {
                    alert(parseInt(Math.random()*10));
        }
HTML..
   <body>
       <input type="button" value="Get Random Number" onclick="ranNumber()" />
  </body>

Change Text Color Randomly ..
         function ChangeTextColor()
        {
            var ob=document.getElementById('s3');
            ob.style.color='#'+parseInt(Math.random()*10)+''+parseInt(Math.random()*10)+''+parseInt(Math.random()*10)+''+parseInt(Math.random()*10)+''+parseInt(Math.random()*10)+''+parseInt(Math.random()*10);
            setTimeout("fun2()",1000);
        }

HTML...
<body onload= "ChangeTextColor()">
            <span id="s1"></span>
</body>

ASP.NET Cookies Management


A cookie is a small bit of text that accompanies requests and pages as they go between the Web server and browser. The cookie contains information the Web application can read whenever the user visits the site.
This topic contains:
  • Scenarios
  • Background
  • Code Examples
  • Class Reference
  • Additional Resources

Scenarios

Cookies provide a means in Web applications to store user-specific information. For example, when a user visits your site, you can use cookies to store user preferences or other information. When the user visits your Web site another time, the application can retrieve the information it stored earlier.

Background

A cookie is a small bit of text that accompanies requests and pages as they go between the Web server and browser. The cookie contains information the Web application can read whenever the user visits the site.
For example, if a user requests a page from your site and your application sends not just a page, but also a cookie containing the date and time, when the user's browser gets the page, the browser also gets the cookie, which it stores in a folder on the user's hard disk.

Sunday 30 September 2012

Change Browser Title & Get The Current page URL Using Java Script

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Girfa......</title>
    <script language=javascript>
        function tit()
        {

            top.document.title=document.forms[0].t1.value;       
        }
        function geturl()
        {
            alert(document.URL);          
        }
       
        function tmp()
        {
            alert();           
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
   
        Enter Title :
        <input type="text" id="t1" />
        <input type=button value="Change Title " onclick="tit()" />
        <br />
        <br />
         <input type=button value="Get URL " onclick="geturl()" />                   
    </form>
</body>
</html>