Visual Programming
Assignment No. 3
Saif Ur Rehman
Assistant Professor
University Institute of Information Technology,
PMAS Arid Agriculture University, Rawalpindi
Instructions
Only Hand Written Assignment will be entertained
Last date of submission is the Day of Final Exam Paper of VP
Copy/Paste/Cheating not allowed
In case of late submission or Failing in submitting the Assignment, you
will get 0 Marks out of 12 in Final Exam Quiz/Assignment Marks
No Excuse will be acceptable
Questions
1) ASP stands for
2) Difference between ASP and ASP.Net
3) Write down some history of ASP.Net
4) Write down 10 Web Sites name, which have been developed using ASP.Net
5) Differentiate between ASP.NET and PHP
6) Which Server is used by ASP.Net web pages to browse/run
7) What is/are the advantages of master page?
8) What are various Web Development technologies exists in Market?
9) Google and tell how you can compare PHP and ASP.Net
10) Write the %ge of Web Sites developed in PHP & ASP.Net in 2015, Google for
answer
11) Can we have Multiple Master Pages in a single web site?
12) Write down the names of at least 10 Dynamic web Sites
13) What are the advantages of a web application
14) How Web Application is different from Window Application
15) Name various Validation Controls in ASP.NET. Discuss their important properties.
16) What are the validation types supported by ASP.NET?
17) What is state management in ASP.NET?
18) What are Tags?
19) Differentiate between Single and Paired Tags? Give Examples of each type of Tags
20) Define Session, SessionId and Session State in ASP.NET.
21) What is Session Identifier?
22) What are the 2 important parts of a master page?
23) Can Master Pages be nested?
24) What is the file extension for a Master Page?
25) How do you identify a Master Page?
26) Give example of using Ordered List Tag in ASP.Net
27) Give example of using Un-Ordered List Tag in ASP.Net
28) Can a Master Page have more than one ContentPlaceHolder?
29) What is an internal modifier?
30) What are namespaces, and how they are used?
31) What is the difference between public, static and void?
32) How does C# differ from C++?
33) What is Extensible Markup Language (XML).
34) Explain the difference between XML and HTML.
35) Which namespaces in .NET are used for XML?
36) What is AJAX?
37) What are the advantages of AJAX?
38) What are the technologies used by AJAX?
39) What are all the controls of Ajax?
40) Explain the three main ways to apply CSS styles to a Web page:
41) What is an ID selector and how is it used?
42) What are the different CSS properties used to change dimensions and what values can
they accept?
43) Differentiate between the following terms
a. .aspx & .cs file
b. HTML & XML
c. Master Page & Content Page
d. Range & Required Field Validator
e. Inline & Internal CSS
f. Internal & External CSS
g. Query String & Sessions
h. Clint & Server
i. Clint & Server Side Code
j. Static & Dynamic Web Site
k. Response.Write & Response.Redirect method
l. ExecuteQuery() & ExecuteNonQuery() method
m. Textbox & Button control
n. Dropdown & Radio button
o. Static & Dynamic Menus
44) Write the complete syntax to add connection string in a web.config file?
45) In which language web.config file is written?
46) How you can group Radio Buttons, so that only one Radio Button can be checked at
run time
47) Uses of <Marquee> Tag, Write down its complete Syntax
48) What are the various types of Attributes used in HTML Tags
49) Write down all the important properties of Static & Dynamic Menus in ASP.Net
50) Write down full C# code to open connection to database
51) Write down CSS class to hide a column in Grid View
52) What are bound field in a grid view control
53) Why SqlConnection class is used
54) Define SQLDataAdapter Class
55) Uses of SQLCommand Class
56) Why Dataset is used
57) How you will fill a TextBox from a dataset name dsEmployees
58) Write down any ten features of Dynamic Web Sites
59) What is the purpose of Data Access Layer?
60) What are the uses of Crystal Report
61) Why Crystal Report is important to ASP.Net Application
62) Write down the ASP.Net Web Page Execution life Cycle
63) Write a generic method to fill a Grid view control, this method will take a query and
fill the grid view
64) What are views in Database? Write down full code to fill a grid view from a view
65) Write down full code to fill a dropdown list from the following table
DB Name : UIIT
Table Name : tblDepartment
Attributes : DepartmentSID, DepartmentName
66) Write a SQL Stored Procedure to
a. Insert new Record from the Table given in Q No. 59
b. Update an existing Record from the Table given in Q No. 59
c. Select all records from the Table given in Q No. 59
d. Delete an existing record from the Table given in Q No. 59
67) What is the purpose of
if(!Page.IsPostBack)
//
68) In which event of a web page the following code is written
if(!Page.IsPostBack)
{
//
69) Using Query string Pass text from following text fields txtName and txtEmail used on
LoginPage.aspx to other web page called Home.aspx
70) Define try-catch-finally block in C# code
71) Why Dropdownlist_SelectedIndexChanged even is used?
72) Why Themes & Skins are used in ASP.Net
73) What is Web Services?
74) What are the advantages of using Web Services
75) Write complete C# code to create a web service to Add two nos
76) Write down full C# code to add new record to tblDepartment in UIIT database given
in above Q No. 59
77) What is the purpose of using GridView1_RowEditing event is used
78) Why RowDeleting of Grid View Control is used?
79) What are the advantages of using XML in ASP.Net?
80) Write down complete C# code to display all the data stored in an XML file. Down
load the any XML file from Google
81) Design a LoginPage.aspx, enter User Id and Password. Authenticate the User from
database, when user is authenticated from database then create a Session store the
User Name and his/her picture and finally show the User Name and Picture on Master
Page.
82) There exist a TextBox named txtName and you want to know if its “Abdullah”. Does
the following validation solve the problem? Explain!
<asp:CompareValidator runat="server” ControToValidate = "txtName"
ControlToCompare = "Abdullah" ErrorMessage = "The value is not Abdullah" />
83) Which control should be used to validate each of the followings:
A password which is entered twice for confirmation ()
The age of the user to be over 21 ()
The date to be after the 10/10/2000 ()
Justify your answer by writing correct Validators and conditions.
84) Write the following application.
The initial page is called Validator.aspx and it has 7 text boxes representing (Name,
Family Name, Address, City, Zip Code, Phone and e-mail address) and a Check button.
User gets the following page after clicking on Check button:
The required validation actions are:
name different from family name,
address at least 2 letters,
city at least 2 letters,
zip-code 5 digits,
phone according to the format XX-XXXXXXX or XXX-XXXXXXX,
e-mail is a valid email.
85) Create new Web Site named UIIT.
DB Name: UIIT
Tables : tblPrograms (ProgramSID, ProgramName)
tblStudents (StudentSID, StdName, ProgramSID)
Sample Data
ProgramSID ProgramName
1 PhD (CS)
2 MS (CS)
3 MCS
4 MIT
5 BS (CS)
6 BS (IT)
StudentSID StdName ProgramSID
1001 Muhammad Abdullah 1
1002 Ayesha Khan 2
1003 Imran Khan 6
1004 Asif Nawaz 3
1005 Saif Ur Rehman 2
1006 Tariq Ali Khan 3
1001 Muhammad Sajid 1
1002 Tobba Rehman 2
1003 Muhammad Bilal 4
1004 Areeba Noor 4
1005 Aziz Ur Rehman 2
1006 Ehtasham Azhar 2
Now, Add Web Form named Programs-Students details. Add a Dropdown, which
should be filled with the Programs Offered by UIIT as given in the tblPrograms
Sample Data. Next, add a Grid view on the Same Web page. By default all the
students enrolled in different programs offered in UIIT must be displayed in Grid
View. When user select a specific Program from Dropdown List then Grid View must
be filled with all the students against the selected Program in Dropdown List.
Multiple Choice Questions
1. DML is provided for
A) Description of logical structure of database
B) Addition of new structure in the database system.
C) Manipulation & processing of database
D) Definition of physical structure of database system
2.'AS' clause is used in SQL for
A) Selection operation
B) Rename Operation
C) Join operation
D) Projection Operation
3. Count function in SQL returns the number of
A) values
B) distinct values
C) groups
D) columns
4. The statement in SQL which allows to change the definition of a table is
A) Alter
B) Update
C) Cteate
D) Select
5. Which of the following is correct.
A) A SQL query automatically eliminates duplicates
B) SQL permits attribute names to be repeated in the same relation
C) A SQL query will not work if there are no indexes on the relations
D) None of the above
6. Which of the following operation is used if we are interested in only certain columns of a table?
A) PROJECTION
B) SELECTION
C) UNION
D) JOIN
7. Which of the following is a legal expression in SQL?
A) SELECT NULL FROM EMPLOYEE;
B) SELECT NAME FROM EMPLOYEE;
C) SELECT NAME FROM EMPLOYEE WHERE SALARY=NULL;
D) None of the above
8. Which of the following is a valid SQL type?
A) CHARACTER
B) NUMERIC
C) FLOAT
D) All of the above
9. Which command is used to select distinct subject (SUB) from the table (BOOK)?
A) SELECT ALL FROM BOOK
B) SELECT DISTINCT SUB FROM BOOK
C) SELECT SUB FROM BOOK
D) All of the above
10. In SQL, which of the following is not a data definition language commands?
A) RENAME
B) REVOKE
C) GRANT
D) UPDATE
11. What does XML stand for?
A. eXtra Modern Link
B. eXtensible Markup Language
C. Example Markup Language
D. X-Markup Language
12. What is the correct syntax of the declaration which defines the XML version?:
A. <xml version="A.0" />
B. <?xml version="A.0"?>
C. <?xml version="A.0" />
D. None of the above
13. Which statement is true?
A. All the statements are true
B. All XML elements must have a closing tag
C. All XML elements must be lower case
D. All XML documents must have a DTD
14. Is it easier to process XML than HTML?
A. Yes
B. No
C. Sometimes
D. Cant say
15. Which of the following programs support XML or XML applications?:
A. Internet Explorer 5.5
B. Netscape D.7
C. RealPlayer.
D. both A and B
16. Kind of Parsers are
A. well-formed
B. well-documented
C. non-validating and validating
D. none of the above
17. Well formed XML document means
A. it contains a root element
B. it contain an element
C. it contains one or more elements
D. must contain one or more elements and root element must contain all other
elements
18. Comment in XML document is given by
A. <?-- -->
B. <!-- --!>
C. <!-- -->
D. </-- -- >
19. When processing an output XML, "new line" symbols
A. are copied into output "as is", i.e. "CR+LF" for Windows, CR for Macintosh, LF
for Unix.
B. are converted to single LF symbol
C. are converted to single CR symbol
D. are discarded
20. Which of the following strings are a correct XML name?
A. _myElement
B. my Element
C. #myElement
D. None of the above
21. Which of the following strings are a correct XML name?
A. xmlExtension
B. xslNewElement
C. XMLElement#123
D. All
22. Which of the following XML fragments are well-formed?
A. <?xml?>
B. <?xml version="A.0"?>
C. <?xml encoding="JIS"?>
D. <?xml encoding="JIS" version="A.0"?>
23. What are the predefined attributes
A. xml:lang
B. xml:space
C. both
D. none.
24. A webpage displays a picture. What tag was used to display that picture?
a. picture
b. image
c. img
d. src
25. <b> tag makes the enclosed text bold. What is other tag to make text bold?
a. <strong>
b. <dar>
c. <black>
d. <emp>
26. Tags and test that are not directly displayed on the page are written in _____ section.
a. <html>
b. <head>
c. <title>
d. <body>
27. Which tag inserts a line horizontally on your web page?
a. <hr>
b. <line>
c. <line direction=”horizontal”>
d. <tr>
28. What should be the first tag in any HTML document?
a. <head>
b. <title>
c. <html>
d. <document>
29. Which tag allows you to add a row in a table?
a. <td> and </td>
b. <cr> and </cr>
c. <th> and </th>
d. <tr> and </tr>
30. How can you make a bulleted list?
a. <list>
b. <nl>
c. <ul>
d. <ol>
31. How can you make a numbered list?
a. <dl>
b. <ol>
c. <list>
d. <ul>
32. Where can you find best quality multiple choice questions?
a. icttrends.com
b. psexam.com
c. prepare.icttrends.com
d. mcqsets.com
33. How can you make an e-mail link?
a. <a href=”xxx@yyy”>
b. <mail href=”xxx@yyy”>
c. <mail>xxx@yyy</mail>
d. <a href=”mailto:xxx@yyy”>
34. What is the correct HTML for making a hyperlink?
a. <a href=”http:// mcqsets.com”>ICT Trends Quiz</a>
b. <a name=”http://mcqsets.com”>ICT Trends Quiz</a>
c. <http://mcqsets.com</a>
d. url=”http://mcqsets.com”>ICT Trends Quiz
35. Choose the correct HTML tag to make a text italic
a. <ii>
b. <italics>
c. <italic>
d. <i>
36. Choose the correct HTML tag to make a text bold?
a. <b>
b. <bold>
c. <bb>
d. <bld>
37. What is the correct HTML for adding a background color?
a. <body color=”yellow”>
b. <body bgcolor=”yellow”>
c. <background>yellow</background>
d. <body background=”yellow”>
38. Choose the correct HTML tag for the smallest size heading?
a. <heading>
b. <h6>
c. <h1>
d. <head>
39. What is the correct HTML tag for inserting a line break?
a. <br>
b. <lb>
c. <break>
d. <newline>
40. What does vlink attribute mean?
a. visited link
b. virtual link
c. very good link
d. active link
41. Which attribute is used to name an element uniquely?
a. class
b. id
c. dot
d. all of above
42. Which tag creates a check box for a form in HTML?
a. <checkbox>
b. <input type=”checkbox”>
c. <input=checkbox>
d. <input checkbox>
43. To create a combo box (drop down box) which tag will you use?
a. <select>
b. <list>
c. <input type=”dropdown”>
d. all of above
44. Which of the following is not a pair tag?
a. <p>
b. < u >
c. <i>
d. <img>
45. To create HTML document you require a
a. web page editing software
b. High powered computer
c. Just a notepad can be used
d. None of above
46. The special formatting codes in HTML document used to present content are
a. tags
b. attributes
c. values
d. None of above
47. HTML documents are saved in
a. Special binary format
b. Machine language codes
c. ASCII text
d. None of above
48. Some tags enclose the text. Those tags are known as
a. Couple tags
b. Single tags
c. Double tags
d. Pair tags
49. The _____ character tells browsers to stop tagging the text
a. ?
b. /
c. >
d. %
50. DBMS is a collection of ………….. that enables user to create and maintain a database.
A) Keys
B) Translators
C) Program
D) Language Activity
MCQs on ASP.NET
1. The Following are the minimum requirement to run Asp.net pages
a) Java Virtual Machine
b) Common Language Runtime
c) Windows explorer
d) Ajax
2. Which of the following denote the property in every validation control?
a) ControlToValidate property
b) Text property
c) Both A) and B)
d) None of the Above
3. In ASP.NET if one wants to set the focus on a particular control
a) Call SETFOCUS
b) Call SETCONTROL
c) Call FOCUS method
d) None of the above
4. The Asp.net server control, which provides an alternative way of displaying text on web
page, is
a) < asp:label >
b) < asp:listitem >
c) < asp:button >
d) <asp:image>
5. What executable unit gets created when we build an ASP.Net application?
a) . DLL
b) . EXE
c) . COM
d) .JAR
6. Which method do you invoke on the DataAdapter control to load your generated dataset
with data?
a) Load
b) Fill (ANS)
c) GetAll
d) None
7. Which of the following can be used to add alternating color scheme in a Repeater
control?
a) AlternatingItemTemplate
b) DataSource
c) ColorValidator
d) None of the Above
8. Which of the following is not a valid state management tool?
a) Querystate
b) Hidden Form Field
c) Application State
d) Cookies
9. What is the lifespan for items stored in viewstate
a) Exists for the Life of the current page
b) 20 mins
c) 2 mins
d) 2 sec
10. When a .aspx page is requested from the web server, the out put will be rendered to
browser in following format.
a) HTML
b) XML
c) WML
d) DXML
11. The GridView control in ASP.NET has which of the following features
a) Automatic data binding
b) Automatic paging
c) Both A) and B)
d) None of the above
12. Who can access Session state variables
a) All Users of an application
b) A Single session
c) All users within a single tunnel
d) All User on a Server
13. Select the control which does not have any visible interface
a) Datalist
b) DropdownList
c) Repeater
d) Datagrid
14. Does the “EnableViewState” allows the page to save the users input on a form
a) Yes
b) No
c) Depends on Query
d) Sometime
15. How do we Delete, Update, Select data in a Dataset
a) Using SQLDataAdapter
b) Using SQLDataReader
c) Using SQLCommand
d) None
16. Which of the following is not a member of ConnectionObject
a) Execute
b) EndTransaction
c) BeginTransaction
d) Open
17. Postback occurs in which of the following forms
a) Winforms
b) HTMLForms
c) Webforms
d) Appforms
18. What is the size of the session ID
a) 32 bit long string
b) 32 bit long double
c) 32 bit long character
d) 32 bit long integer
19. Why is Global.asax is used for ?
a) To implement application & Session level events
b) To store configuration information
c) To store styling information
d) None of the above
20. Which method do you invoke on the Data Adapter control to load your generated dataset
a) Fill ( )
b) ExecuteQuery ( )
c) Read ( )
d) ExecuteReader()
21. Which of the following is not a member of ADODBCommand object
a) ExecuteReader
b) ExecuteStream
c) Open
d) CommandText
22. Which of the following is true about session in ASP.NET?
a) Programmers has to take care of delete sessions after configurable timeout
interval
b) ASP.NET automatically delete sessions after configurable timeout interval
c) The default time interval is 5 minutes
d) None of the Above
23. What is the default session out time
a) 20 Sec
b) 20 Min
c) 1 hr
d) 15 Min
24. What is the out put of the following code
a. byte a=200;
b. byte b=100;
c. byte c=a+b;
i. Response.Write ( C );
a) Run time Error
b) Compile Time error
c) 300
d) Just prints “C”
25. What is the advantage of Disconnected mode of ADO.Net in ASP.Net
a) Automatically dump data at client PC
b) Not necessary to connect with server
c) user data can update and retrieve in dataset and when connection connected,
update values with server
d) All of the above
26. Which of the following languages can be used to write server side scripting in ASP.NET?
a) C#
b) C
c) Visual Basic
d) J#
27. Find the term: The .NET framework which provides automatic memory management
using a technique called
a) Serialization
b) Garbage Collection
c) Assemblies
d) Overriding
28. If one has two different web form controls in a application and if one wanted to know
whether the values in the above two different web form control match what control must
be used?
a) DataList
b) GridView
c) CompareValidator
d) Listview
29. What data types do a Rangevalidator supports
a) Integer
b) String
c) Date
d) All of the above
30. I have an ASP.NET application. I have a page loaded from server memory. At this
instance which of the following methods gets fired
a) Unload( )
b) Load()
c) PreRender( )
d) None of the Above
31. In ASP.NET the sessions can be dumped by using
a) Session.Dump
b) Session.Abandon
c) Session.Exit
d) None of the Above
32. Which of the following is FALSE?
a) ASP.NET applications run without a Web Server
b) ASP+ and ASP.NET refer to the same thing
c) ASP.NET is a major upgrade over ASP
d) None of the Above
33. Give One word: Common type system is built into which of the following:
a) CLR
b) RCT
c) RCW
d) GAC
34. The control used in ASP.NET to display information from data set but with better
formatting and editing behavior is
a) Panel
b) Button
c) DataList
d) None of the Above
35. What is the purpose of code behind ?
a) To separate different sections of a page in to different files
b) To merge HTML layout and code in to One file
c) To separate HTML Layout and code to different file
d) To ignore HTML usage
36. How do you manage states in asp.net application
a) Session Objects
b) Viewstate
c) Cookies
d) All of the above
37. What is the significance of Server .MapPath
a) Returns the physical file path that corresponds to virtual specified path
b) Returns the Virtual Path of the web folder
c) Maps the specified virtual path to Physical path
d) None
38. How many classes can a single .NET DLL contain?
a) One
b) Two
c) None
d) Many
39. Which of the following allow writing formatted output?
a) Response.Write()
b) Response.Output.Write()
c) Both A) and B)
d) None of the Above
40. Why is Global.asax is used
a) Implement application and session level events
b) Declare Global variables
c) Both (A) and (B)
d) No use
41. A developer wanted to achieve graphics in his display using ASP.NET. Which of the
following web controls are available in ASP.NET to achieve the above?
a) Both A) and B)
b) LinkButton
c) AdRotator
d) None of the Above
42. Which control supports paging
a) Repeater
b) Datagrid
c) Both
d) None
43. What is the extension of a global file ?
a) .Asmx
b) . Ascx
c) .Aspx
d) .Ajax
44. Which of the following must be done in order to connect data from some data resource to
Repeater control?
a) Set the DataSource property
b) Call the DataBind method
c) Both A) and B)
d) None of the Above
45. What tags one need to add within the asp:datagrid tags to bind columns manually?
a) Set AutoGenerateColumns Property to false on the datagrid tag
b) Set AutoGenerateColumns Property to true on the datagrid tag
c) It is not possible to do the operation
d) Set AutomaunalColumns Property to true on the datagrid tag
46. The .NET Framework provides a runtime environment called
a) RMT
b) CLR
c) RCT
d) RC
47. What is the out put of Following code
String a=”Hello”;
String b=”World”;
String c= a+b;
Response.Write ( “C “);
a) Hello world
b) C
c) A+b
d) None of the above
48. Which of the following denote ways to manage state in an ASP.Net Application?
a) Session objects
b) Application objects
c) ViewState
d) All the Above
49. Select the validation control used for “PatternMatching”
a) FieldValidator
b) RegularExpressionValidator
c) RangeValidator
d) PatternValidator
50. How do you explicitly kill a user’s session ?
a) Session.Close ( )
b) Session.Discard ( )
c) Session.Abandon ()
d) Session.End()
51 Which webserver is developed by Microsoft?
[A] Apache Tomcat
[B] Caudium
[C] Internet Information Services (IIS)
[D] WEBrick
52. Which protocol is used to transfer files frtom localhost to remote host?
[A] HTTP
[B] FTP
[C] TCP
[D] UDP -
53 Which of the following is not an ASP.NET page event?
[A] Init
[B] Load
[C] Import
[D] Disposed
54. In which of the following folder source code such as class, dataset etc. are stored?
[A] App_Data
[B] App_Themes
[C] App_Code
[D] App_WebReferences
55. In ASP.NET web application configuration settings are defined in
[A] ProcompiledApp.config
[B] machine.config
[C] Web.config
[D] System.
56. What is the correct HTML for referring to an external style sheet?
<style src="mystyle.css">
<stylesheet>mystyle.css</stylesheet>
<link rel="stylesheet" type="text/css" href="mystyle.css">
57. Where in an HTML document is the correct place to refer to an external style sheet?
In the <body> section
At the end of the document
In the <head> section
58. Which HTML tag is used to define an internal style sheet?
<style>
<script>
<css>
59. Which HTML attribute is used to define inline styles?
styles
class
style
font
60. Which is the correct CSS syntax?
{body;color:black;}
{body:color=black;}
body {color: black;}
body:color=black;
61. Which property is used to change the background color?
color
bgcolor
background-color
62. How do you add a background color for all <h1> elements?
h1.all {background-color:#FFFFFF;}
all.h1 {background-color:#FFFFFF;}
h1 {background-color:#FFFFFF;}
63. How do you display hyperlinks without an underline?
a {underline:none;}
a {decoration:no-underline;}
a {text-decoration:no-underline;}
a {text-decoration:none;}
64. How do you make each word in a text start with a capital letter?
text-transform:uppercase
text-transform:capitalize
You can't do that with CSS
65. Which property is used to change the font of an element?
font
Both font-family and font can be used
font-family
66. Who is making the Web standards?
The World Wide Web Consortium
Microsoft
Google
Mozilla
Prepared By:
Saif ur Rehman
Assistant Professor
UIIT, PMAS Arid Agriculture University, Rawalpindi