Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

ASSIGNMENT

BCA 5
TH
SEMESTER
SUBJECT BC0053 VB.NET XML

BY- ANURAG KUMAR
ROLL NO- 571116211




1. Describe Visual Studio .NET and the .NET Framework

Answer: The .NET Framework (pronounced dot net framework) defines the environment that
you use to execute Visual Basic .NET applications and the services you can use within those
applications. One of the main goals of this framework is to make it easier to develop applications
that run over the Internet.

However, this framework can also be used to develop traditional business applications that run
on the Windows desktop. To develop a Visual Basic .NET application, you use a product called
Visual Studio .NET (pronounced Visual Studio dot net). This is actually a suite of products that
includes the three programming languages.

Visual Studio also includes several other components that make it an outstanding development
product. One of these is the Microsoft Development Environment, which youll be introduced to
in a moment. Another is the Microsoft SQL Server 2000 Desktop Engine (or MSDE). MSDE is a
database engine that runs on your own PC so you can useVisual Studio for developing database
applications that are compatible with Microsoft SQL Server.

SQL Server in turn is a database management system that can be used to provide the data for
large networks of users or for Internet applications. The two other languages that come with
Visual Studio .NET are C# and C++. C# .NET (pronounced C sharp dot net) is a new language
that has been developed by Microsoft especially for the .NET Framework. Visual C++ .NET is
Microsofts version of the C++ language that is used on many platforms besides Windows PCs.


In this figure, you can see that Visual Studio .NET can be used on any PC that runs Windows
2000 or later. You can also see that the applications that are developed with Visual Studio .NET
can be run on any PC that runs Windows 98 or later, depending on which .NET components are

ASSIGNMENT
BCA 5
TH
SEMESTER
SUBJECT BC0053 VB.NET XML

BY- ANURAG KUMAR
ROLL NO- 571116211


used by the application. From a practical point of view, though, you can assume that the
applications that you develop with Visual Basic .NET will be run on PCs that are using Windows
2000 or later.

This figure also shows that Visual Basic .NET comes in an inexpensive Standard Edition that
includes only the Visual Basic language, not C# orC++. All but one of the Visual Basic features
presented in this book work with the Standard Edition as well as the full Visual Studio .NET.
Although the three languages shown in this figure are the only three programming languages
you can use within Visual Studio .NET, other vendors are free to develop languages for the .NET
Framework. For example, Fujitsu has already developed a version of COBOL for the .NET
Framework.


2. List the various Arithmetic, Concatenation, Comparison, Logical and Bitwise Operators.

Answer: Arithmetic and Concatenation Operators
Exponentiation (^)
Unary identity and negation (+, )
Multiplication and floating-point division (*, /)
Integer division (\)
Modulus arithmetic (Mod)
Addition and subtraction (+, ), string concatenation (+)
String concatenation (&)
Arithmetic bit shift (<<, >>)

Comparison Operators
All comparison operators (=, <>, <, <=, >, >=, Is, IsNot, Like, TypeOf...Is)

Logical and Bitwise Operators
Negation (Not)
Conjunction (And, AndAlso)
Inclusive disjunction (Or, OrElse)
Exclusive disjunction (Xor)


3. State important properties and methods of an Exception.

Answer: Important properties and methods of an Exception
Property Description
HelpLink A string indicating the link to help for this exception
InnerException Returns the exception object reference to an inner(nested) exception
Message A string that contains a description of the error, suitablefor displaying to users

ASSIGNMENT
BCA 5
TH
SEMESTER
SUBJECT BC0053 VB.NET XML

BY- ANURAG KUMAR
ROLL NO- 571116211


Source A string containing the name of an object that generatedthe error
StackTrace A read-only property that holds the stack trace as a textstring. The stack trace
is a list of the pending methodcalls at the point at which the exception was
detected.That is, if MethodA called MethodB, and an exceptionoccurred in
MethodB, the stack trace would contain bothMethodA and MethodB.
TargetSite A read-only string property that holds the method that threw the exception

Method Description
GetBaseException Returns the first exception in the chain
ToString Returns the error string, which might include as muchinformation as the
error message, the inner exceptions, and the stack trace, depending on
theerror


4. List some of the applications of XML and related technologies.

Answer: Applications of XML
CML (Chemical markup language): This is used to describe molecular structure.
Mathml: This is for representing mathematical formulae.
XHTML: This is for Reformulation of html using XML.
B2B (Business to Business): XML is now being pushed in this area. This enables two
entirely different products to exchange data using XML.
Cell Phones: XML data is sent to some cell phones. The data is thenformatted by the
specification of the cell phone software designer todisplay text or images, and even to
play sounds!
File Converters: Many applications have been written to convertexisting documents
into the XML standard. An example is a PDF to XMLconverter.
VoiceXML: Converts XML documents into an audio format so that you can listen to an
XML document.

XML related Technologies
SGML (Standard generalized markup language): It is basis for allmarkup languages.
XSL (Extensible style sheet languages): It is a combination of xml andstyle sheets, i.e.
XSL=XML+Stylesheets.
XSLT ( XSL transformations): It provides rules for transformations fromone XML to
another
SOAP (simple object access protocol): It is a communication protocol forInternet to
XML documents and it provides notifications for events.
SAX (simple API for XML): SAX predefined application packageinterface.
DOM: Document Object Model.



ASSIGNMENT
BCA 5
TH
SEMESTER
SUBJECT BC0053 VB.NET XML

BY- ANURAG KUMAR
ROLL NO- 571116211


5. Design a form to create basic calculator in VB.NET.

Answer: Steps to prepare a form to perform calculator functions using vb.net:
1. Open Visual Basic 6.0 and create a new Standard EXE Project. Standard EXE projects give you
a handful of commands and tools, useful to develop simple as well as semi-complex programs.

2. Understand the project screen. In the center of the screen will be a box with a lot of dots. This
is your form. A form is the place where you will add the various elements (command buttons,
pictures, text boxes, etc) to your program.
To the left of the screen is the toolbox. The Toolbox contains various pre-defined
elements of any program. You can drag and drop these elements onto your form.
To the lower right of the screen is the form layout. This determines where your program
will be displayed on the screen once the project is complete and executed.
On the mid-right is the properties box which determine the property of any element that
is selected in a form. You can change various properties using this. If no element is
selected, it displays the properties of the form.
On the top-right is the project explorer. It shows the various designs, forms that are
included in a project.
If any of these boxes is missing, you can add them by clicking on the "View" button on
the Menu bar.

3. Drag a label onto the form, and change the caption of the label to "Enter first number". The
caption of a label can be changed using the properties box.

4. Create a textbox to the right of the first label. Remove any text that appears inside the textbox
by changing blanking the "Text" field in properties box.

5. Create another label and change the caption to "Enter second number" and create another
textbox to its right.

6. Drag and create four command buttons below these two labels. Change the caption of these
command buttons to "Add", "Subtract", "Multiply", "Divide" respectively.

7. Create another label with a caption "Result" and a textbox to the right of it below the four
command buttons. This textbox will be used to display the result. With this, your design is
complete.

8. To start coding, in the project explorer, click on the form and then select the left-most button.
It will take you to the coding screen. Click on the list box in the top-left of the coding screen. One
by one, click on all the commands (Command1, Command2, etc) so that the outline coding of
them will be visible to you on your coding screen.

9. Declare the variables. To declare:

ASSIGNMENT
BCA 5
TH
SEMESTER
SUBJECT BC0053 VB.NET XML

BY- ANURAG KUMAR
ROLL NO- 571116211


Dim a, b, r as Integer
a is the value entered in the first textbox, b is the value entered in the second textbox
and r is the result. You can any other variables too.

10. Start the coding for the add command (Command1). The code will be as follows:
Private Sub Command1_Click()
a = Val(Text1.Text)
b = Val(Text2.Text)
r = a + b
Text3.Text = r
End Sub

11. Code for the subtract command (Command2). The code will be as follows:
Private Sub Command2_Click()
a = Val(Text1.Text)
b = Val(Text2.Text)
r = a - b
Text3.Text = r
End Sub

12. Code for the multiply command (Command3). The code will be as follows:
Private Sub Command3_Click()
a = Val(Text1.Text)
b = Val(Text2.Text)
r = a * b
Text3.Text = r
End Sub

13. Code for the divide command (Command4). The coding will be as follows:
Private Sub Command4_Click()
a = Val(Text1.Text)
b = Val(Text2.Text)
r = a / b
Text3.Text = r
End Sub

14. Click the start button or press F5 to execute your program.
Test all the commands and see if your program is working.

15. Save your project and your form. Make your project and save it as a .exe file on your
computer; run it whenever you want!


ASSIGNMENT
BCA 5
TH
SEMESTER
SUBJECT BC0053 VB.NET XML

BY- ANURAG KUMAR
ROLL NO- 571116211



6. Write a XML with database with book details (BOOK ID, Title, Author, subject,
published Year, language, vendor, price)

Answer: XML with database with book details:
1. Open your text editor of choice, and create a new file. A text editor can also be a word
processing program.

2. Type the following XML syntax in the file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
</xml>
Please note that all elements, aka tags, are enclosed within "<" and ">" symbols, and that closing
elements have a "/" symbol to differentiate them from opening elements.

3. Save the file to the web server with the name "Books.xml".

4. Type the following between the opening and closing "xml" elements:
<Books>
</Books>

5. Type the following between the opening and closing "Books" elements:
<Book>
</Book>

6. Type the following between the opening and closing "Book" elements:
<ISBN></ISBN>
< BOOK ID ></ BOOK ID >
<BookTitle></BookTitle>
< Author ></ Author >
<subject></ subject >
<published Year ></ published Year >
<language></ language >
<vendor></ vendor >
<price></ price >

7. Type the following between the opening and closing "ISBN" elements: 978-1-890774-50-9

8. Type the following between the opening and closing "BookTitle" elements:
Murach's Oracle SQL and PL/SQL

9. Type the following between the opening and closing "Edition" elements: 1st

10. Type the following between the opening and closing "Author" elements: Rahul Singh

ASSIGNMENT
BCA 5
TH
SEMESTER
SUBJECT BC0053 VB.NET XML

BY- ANURAG KUMAR
ROLL NO- 571116211



11. Type the following between the opening and closing "Cost" elements: Rs.500
Create and Reference an XSD File

12. Create a new file in your text editor.

13. Type the following XML syntax in the file where domain_name is the domain of your site:
<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:target="http://domain_name/Book" targetNamespace="http://domain_name/Book">
</schema>

14. Type the following between the opening and closing "schema" elements:
<element name="Book">
<complexType>
<sequence>
<element name="ISBN" type="string" />
<element name=" BOOK ID" type="string" />
<element name="BookTitle" type="string" />
<element name=" Author" type="string" />
<element name=" subject" type="string" />
<element name=" published Year" type="string" />
<element name=" language" type="string" />
<element name=" vendor" type="string" />
<element name=" price" type="string" />
</sequence>
</complexType>
</element>

15. Save the file to the web server with a name "Books.xsd."

16. Refer to the location of the file in the "Book" element of your "Books.xml" file as follows:
<Bookxmlns="http://domain_name/Book"
xmlns:xsdi="http://www.w3.org/2001/XMLSchema-instance"
xsdi:schemaLocation="http://domain_name/Book Books.xsd">

You might also like