Showing posts with label Net Centric Computing. Show all posts

Create a dictionary object with the following keys and item using VBScript.


i.                     
Keys
Items
Key1
Item1
Key2
Item2
Key3
Item3
ii.                  Check whether “key3” exists?
iii.                Show the value of “key1”
iv.                Change the value of a key or item
v.                  Show the iteration through a dictionary, with the list of keys and items

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
            <% DIM dict
            Set dict=Server.CreateObject("Scripting.Dictionary")
            dict.Add "Key1","Item1"
            dict.Add "Key2","Item2"
            dict.Add "Key3","Item3"
            'p= dict.Exists "Key3"
            response.Write("Does Key3 exists?    ")
            response.Write(dict.Exists("Key3"))
            response.Write("<br>Return the value of Key1         ")
response.Write(dict.Item("Key1"))    
response.Write("<br>The changed value of the given Key1 is as<br>")
dict.Item("Key1")="Ankura"
response.Write(dict.Item("Key1"))
dim arrKey,arrItem
arrKey=Key()
arrItem=Item()
for i=0 to dict.Count-1
Response.Write ("<br>Key = "& arrKey(i)&"&nbsp;Item = "& arrItem(i))
next
%>      
</body>
</html>
Learn more »

Write a program for email handling in ASP.

The code is given below:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
          <%
                   Dim mail
                   Set mail=Server.CreateObject("CDO.Message")
                   mail.To=Request.Form("to")
                   mail.From=request.Form("from")
                   mail.Subject=request.Form("subject")
                   mail.TextBody=Request.Form("body")
                   mail.Send()
                   Response.Write("Mail Sent")
                   Set mail=nothing
          %>
         
                  
    <form id="form1" name="form1" method="post" action="">
      <table width="100%" border="5" cellspacing="5" cellpadding="10">
        <tr>
          <td><label>To</label></td>
          <td><input type="text" name="to" /></td>
        </tr>
        <tr>
          <td><label>From</label></td>
          <td><input type="text" name="from" /></td>
        </tr>
        <tr>
          <td><label>Subject</label></td>
          <td><input type="text" name="subject" /></td>
        </tr>
        <tr>
          <td>Body</td>
          <td><textarea name="body"></textarea></td>
        </tr>
        <tr>
          <td><label></label></td>
          <td><label>
            <input type="submit" name="Submit" value="Submit" />
          </label></td>
        </tr>
      </table>
</form>
</body>
</html>
Learn more »

What are the steps requried for desining an ASP based application?


The steps required for designing an ASP based application are listed below:
1.       Creating the design requirements
2.       Creating the user interface
3.       Writing source code for the ASP .NET page
4.       Testing the ASP.NET web page


Step 1: Creating the design requirements

 While developing software, based on ASP application we need to decide, what is the purpose of developing it along with its features and functionalities. For this, we should list out the requirements and features of software like
·         Resources consumption
·         Information about users
·         Planning activities
·         Software feasibility

Step 2: Creating the user interface

The next step after collection of design requirements is creating user interface. User interface (UI) maintains the user interaction with the application. Inputs and outputs from the user are synchronized in this phase. UI is the HTML portion of ASP.NET web page. It includes adding needed web controls to the ASP.NET web page. Web controls like textbox, button, checkbox etc can be used for inputs and label can be used for output. Validation technologies can also be applied in this phase.


Step 3: Writing the source code for ASP.NET web page

After completion of HTML portion of our ASP.NET web page, source code will be next step. Source code will read the user’s inputs, performs necessary computation and provides output. Source code includes reading values from web controls like textbox or when some event triggers, displaying outputs, page loading etc. Source code can be written in any scripting language like JScript, VBScript, JavaScript etc.

Step 4: Testing the ASP.NET web page

Testing is done in order to check whether developed web page works as per need of user or not.
It is done simply by taking some inputs and visualizing the outputs. Then output is matched with user requirements and deviation is calculated. Further deviation is reduced by reanalyzing the steps.
ASP page
ASP  Page


Learn more »

What do you mean by stored procedures? What are its importances? Explain with an example.


Stored Procedures
 A stored procedure (or stored query as it's sometimes called) is a predefined SQL query stored on the database.

Importance of Stored Procedures:

Why should we create and use a stored procedure instead of just creating a SQL string? Well, there are several reasons:
  • A stored procedure is compiled by the database. This produces an execution plan, so the database knows exactly what it's going to do. This makes the execution of the procedure faster.
  • Stored procedures are often cached by the database, thus making them faster to run, as they don't have to be read from disk.
  • You can make your data a little bit more secure by specifying that your database tables can be modified only by stored procedures.
  • You avoid cluttering your ASP code with lengthy SQL statements. This makes the ASP code easier to maintain.
  • You can keep all of the SQL code together, on the server.
  • You can use output parameters in a stored procedure, which allows you to return both a recordset and other values.

Syntax of Stored Procedures

Syntax for creating stored procedure:
            --Creating stored procedure
CREATE PROCEDURE SP_Name
AS
BEGIN
      <Body part>
END

Example of Stored Procedures

--Creating stored procedure
CREATE PROCEDURE SP_UPDATETABLE
AS
BEGIN
      UPDATE STUDENT_INFO
      SET NAME='HARI' WHERE ROLLNO=102
END

Learn more »

What are the Modules integrated in IIS?


IIS 7 Modules
IIS 7 provides a new architecture that is different from previous versions of IIS. Instead of keeping the majority of functionality within the server itself, IIS 7 includes a Web server engine in which you can add or remove components, called modules, depending on your needs.
Modules are individual features that the server uses to process requests. For example, IIS uses authentication modules to authenticate client credentials, and cache modules to manage cache activity.
The new architecture provides the following advantages over previous versions of IIS:
You can control which modules you want on the server.
You can customize a server to a specific role in your environment.
You can use custom modules to replace existing modules or to introduce new features.

HTTP Modules
Several modules in IIS 7 perform tasks specific to Hypertext Transfer Protocol (HTTP) in the request-processing pipeline. HTTP modules include modules to respond to information and inquiries sent in client headers, to return HTTP errors, to redirect requests, and more.

Security Modules
Several modules in IIS 7 perform tasks related to security in the request-processing pipeline. In addition, there are separate modules for each of the authentication schemes, which enable you to select modules for the types of authentication you want on your server. There are also modules that perform URL authorization, and a module that filters requests.

Content Modules
Several modules in IIS 7 perform tasks related to content in the request-processing pipeline. Content modules include modules to process requests for static files, to return a default page when a client doesn't specify a resource in a request, to list the contents of a directory, and more.

Compression Modules
Two modules in IIS 7 perform compression in the request-processing pipeline.

Caching Modules
Several modules in IIS 7 perform tasks related to caching in the request-processing pipeline. Caching improves the performance of your Web sites and Web applications by storing processed information, such as Web pages, in memory on the server, and then reusing that information in subsequent requests for the same resource.

Logging and Diagnostics Modules
Several modules in IIS 7 perform tasks related to logging and diagnostics in the request-processing pipeline. The logging modules support loading of custom modules and passing information to HTTP.sys. The diagnostics modules follow and report events during request processing.

Managed Support Modules
A couple of modules in IIS 7 support managed integration in the IIS request-processing pipeline.
Learn more »