VB.Net Interview Questions

October 16th, 2008

What is the purpose of .net frame work? 
.Net Framework is an umbrella technology and has a lot of different technologies under it. For example, it
1. introduces Asp.net for web development
2. has languages to write Windows program, Windows services, Web Services.
3. pre-coded solutions to common programming problems     called base class library. It includes user interface data accessdatabase connectivity cryptography web application development, numeric algorithms, and network communications
4. a runtime or virtual machine that manages the execution of programs written specifically for the framework,
5. and a set of tools for configuring and building applications  like visual studio.
It also introduces language independence by introducing common language runtime. You can write code in any language.
The .NET Framework is a key Microsoft offering and is intended to be used by most new applications created for the Windows platform.

What is the difference between visual basic and visual basic dot net?
VB.NET is Microsoft’s Visual Basic implemented onto their .NET Framework. While Visual Basic is part of Visual Studio, VB.NET is also part of the Visual Studio.NET release.

What is JIT(Just In Time) and How it works? 
Before the code can be executed,the .NET framework needs to convert the IL into CPU-specific code.the Just-In-Time(JIT) compiler translates the code from IL into managed native code.During the compilation,the JIT compiler compiles only the code that is required during execution instead of compiling the complete IL code.when an uncompiled method is invoked during execution,the JIT compiler converts the IL for that method into native code.during this  the code is also checked for type safety,Type safety ensures that objects are always accessed in a compilation way.
 
 

 

C# Interview Questions

October 11th, 2008

What’s the top .NET class that everything is derived from?
System.Object.

Does C# support multiple-inheritance?
No.

Who is a protected class-level variable available to?
It is available to any sub-class (a class inheriting this class).

Are private class-level variables inherited?
Yes, but they are not accessible. Although they are not visible or accessible via the class interface, they are inherited.

Describe the accessibility modifier “protected internal”?
It is available to classes that are within the same assembly and derived from the specified base class.

What does the term immutable mean?
The data value may not be changed. Note: The variable value may be changed, but the original immutable data value was discarded and a new data value was created in memory.

What’s a delegate?
A delegate object encapsulates a reference to a method.

What’s a multicast delegate?
A delegate that has multiple handlers assigned to it. Each assigned handler (method) is called.

Is XML case-sensitive?
Yes.

What’s the difference between // comments, /**/ comments and /// comments?
Single-line comments, multi-line comments, and XML documentation comments.

How do you generate documentation from the C# file commented properly with a command-line compiler?
Compile it with the /doc switch.

What’s the difference between System.String and System.Text.StringBuilder classes?
System.String is immutable. System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.

Can you store multiple data types in System.Array?
No.

What’s the advantage of using System.Text.StringBuilder over System.String?
StringBuilder is more efficient in cases where there is a large amount of string manipulation. Strings are immutable, so each time a string is changed, a new instance in memory is created.

Will the finally block get executed if an exception has not occurred?
Yes.

What’s the difference between the System.Array.CopyTo() and System.Array.Clone()?
The Clone() method returns a new array (a shallow copy) object containing all the elements in the original array. The  CopyTo() method copies the elements into another existing array. Both perform a shallow copy. A shallow copy means the contents (each array element) contains references to the same object as the elements in the original array. A deep copy (which neither of these methods performs) would create a new instance of each element’s object,resulting in a different, yet identacle object.

How can you sort the elements of the array in descending order?
By calling Sort() and then Reverse() methods.

What’s the .NET collection class that allows an element to be accessed using a unique key?
HashTable.

What’s the C# syntax to catch any possible exception?
A catch block that catches the exception of type System.Exception. You can also omit the parameter data type in this case and just write catch {}.

Can multiple catch blocks be executed for a single try statement?
No. Once the proper catch block processed, control is transferred to the finally block (if there are any). 

Explain the three services model commonly know as a three-tier application?
Presentation (UI), Business (logic and underlying code) and Data (from storage or other sources).

ASP.Net Interview Questions

October 11th, 2008

ASP.Net is a language or not? 
ASP.NET is not a language.It’s a frame work we can use to develop websites.

What is aspx? 
aspx is the extension used for Microsoft ASP.NET web pages.
ASP.NET is a framework that runs on the MS web server and allows for rich dynamic content. aspx files are compiled rather than interpreted, and run much faster than other scripted files.

What is the difference between ASP.NET &VB.NET?
Asp.net and vb.net both are in dot net family but asp.net is used to develop web site(web application) and vb.net is used to create a windows application.

What is the major difference between asp.net and c#.net? 
Asp.net is used to develop a web application by either using vb or c# based syntax. C#.net is used to develop a windows application.

What is the .net,why we use .net.what is the advantage to using .net other programming languages? 
.net is not a technology or language .it is an environment to develop an application either web/window/console based
It provide the ability to achieve versioning.
Remove legacy/dependancy over os end the com based componet.
Can acheieve side by side exceution.

What is Web.config file in ASP.NET? 
Web.config file, as it sounds like is a configuration file for the Asp .net web application.An Asp.net application has one web.config file which keeps configurations required for the corresponding application.Web.config file is written in XML with specific tags having specific meanings.We have Machine.config file also. As web.config file is used to configure one asp .net web application, same way Machine.config file is used to configure the application according to a particular machine. That is, configuration done in machine.config file is affected on any application that runs on a particular machine. Usually, this file is not altered and only web.config is used which configuring applications. 

What is the trace in ASP.NET? 
ASP.NET introduces new functionality that allows you to view diagnostic information about a single request for an ASP.NET page simply by enabling it for your page or application. Called tracing, this feature also allows you to write debug statements directly in your code without having to remove them from your application when it is deployed to production servers. You can write variables or structures in a page, assert whether a condition is met, or simply trace through the execution path of your page or application.  

What is Viewstate? 
View state is used by the ASP.NET page framework to automatically save the values of the page and of each control just prior to rendering to the page.When the page is posted, one of the first tasks performed by page processing is to restore view state. State management is the process by which you maintain state and page information over multiple requests for the same or different pages. 

Diffrence Between ServerSide and ClientSideCode ? 
server side code is responsible to execute and provide the executed code to the browser at the client side. The executed code may be either in XML or Plain HTML the executed code only have the values or the results that are executed on the server. The clients browser executes the HTML code and displays the result where as the client side code executes at client side and displays the result in its browser.The client side core consist of certain functions that are to be executed on server then it places request to the server and the server responses as the result in form of HTML.
 

Diffrence Between ServerSide and ClientSideCode ? 
Server side code is responsible to execute and provide the executed code to the browser at the client side. The executed code may be either in XML or Plain HTML the executed code only have the values or the results that are executed on the server. The clients browser executes the HTML code and displays the result where as the client side code executes at client side and displays the result in its browser.The client side core consist of certain functions that are to be executed on server then it places request to the server and the server responses as the result in form of HTML. 
 

Define three test cases you should go through in unit testing? 
1)Positive test cases (correct data, correct output).
2)Negative test cases (broken or missing data,proper handling).
3)Exception test cases (exceptions are thrown and caught properly).

What debugging tools come with the .NET SDK?
1. CorDBG – command-line debugger. To use CorDbg, you must compile the original C# file using the /debug switch.
2. DbgCLR – graphic debugger. Visual Studio .NET uses the DbgCLR. 
 
Where are shared assemblies stored ? 
Global assembly cache.

What is a web services? 
Web services is a excellent way of performing remote method calls.
Its a platform independent one because it follows the xml standards.
We can find the available services in http://uddi.org/ is the place for universal description,discovery and integration of web services.

What is the transport protocol you use to call a Web service? 
SOAP is the preferred protocol.

How can you debug failed assembly binds? 
Use the Assembly Binding Log Viewer (fuslogvw.exe) to find out the paths searched.  

What is the purpose of .net frame work? 
Net Framework is an umbrella technology and has a lot of different technologies under it. For example, it
1. Introduces Asp.net for web development
2. Has languages to write Windows program, Windows services, Web Services.
3. Pre-coded solutions to common programming problems   called base class library. It includes user interface data accessdatabase connectivity cryptography web application development, numeric algorithms, and network communications
4. A runtime or virtual machine that manages the execution of programs written specifically for the framework,and a set of tools for configuring and building applications  like visual studio.

It also introduces language independence by introducing common language runtime. You can write code in any language.
The .NET Framework is a key Microsoft offering and is intended to be used by most new applications created for the Windows platform. 

What is the difference between Server.Transfer and Response.Redirect? Why would I choose one over the other? 
Server.Transfer is used to post a form to another page. Response.Redirect is used to redirect the user to another page or site. 

Name two properties common in every validation control?
ControlToValidate property and Text property.

What is Satellite Assemblies?
Satellite assemblies are often used to deploy language-specific resources for an application. These language-specific assemblies work in side-by-side execution because the application has a separate product ID for each language and installs satellite assemblies in a language-specific subdirectory for each language. When uninstalling, the application removes only the satellite assemblies associated with a given language and .NET Framework version. No core .NET Framework files are removed unless the last language for that .NET Framework version is being removed. For example, English and Japanese editions of the .NET Framework version 1.1 share the same core files. The Japanese .NET Framework version 1.1 adds satellite assemblies with localized resources in a \\ja subdirectory. An application that supports the .NET Framework version 1.1, regardless of its language, always uses the same core runtime files. 

What data type does the RangeValidator control support?
Integer,String and Date.

What is Web.config file in ASP.NET? 
Web.config file, as it sounds like is a configuration file for the Asp .net web application. An Asp .net application has one web.config file which keeps configurations required for the corresponding application. Web.config file is written in XML with specific tags having specific meanings.We have Machine.config file also. As web.config file is used to configure one asp .net web application, same way Machine.config file is used to configure the application according to a particular machine. That is, configuration done in machine.config file is affected on any application that runs on a particular machine. Usually, this file is not altered and only web.config is used which configuring applications.

What do you mean Class?
Class is an organized store-home in object-oriented programming that gives coherent functional abilities to a group of related code. Its are definition of an object, made up of software code. Using classes, you may wrap data and behavior together (Encapsulation).you may define classes in terms of classes (Inheritance).We can also override the behavior of a class using an alternate behavior (Polymorphisms).

Difference between Abstract and Interface?  
1.We can’t create instances for both
2.Single inheritance in abstract class, multiple inheritance in interface
3.We can have concrete method in abstact class but not in the interface
4.Any class that needs to use abstract must extent
5.Any class that needs to use interface must implement
6.Interface all the variables are static and final.

What’s the difference between private and shared assembly?
Private assembly is used inside an application only and does not have to be identified by a strong name. Shared assembly can be used by multiple applications and has to have a strong name.

In your asp.net application there is a textbox, How can clear the textbox with out round trip?
Assume that your textbox ID is txt. And the button ID is btn. If you want to clear the text from textbox by clicking the button without refresh then do the following steps.

1) In Page_Load  write

btn.Attributes.Add(\”OnClick\”,\”clearIt();\”);

2) In javascript write the function

function clearIt()

{

document.getElementById(\’txt\’).value = \”\”;

}

Can we use http handlers to upload a file in asp.net? 
You can use HttpHandlers. But it is very limited. You can not get response back (status) if you use it. And it is very complex also. Generally we use Http Handlers to handle requests at Server Side like Putting common Authentication on Web services whole organization wide like this.

What is user control? 
User Control are the controls created by user. User Controls are created with the file .ascx extension. Suppose if same controls are to be repeated in several pages,we can create a user control and display it in all those pages. They have to be registered in the page with @Register directive.

Suppose you want a certain ASP.NET function executed on MouseOver for a certain button. Where do you add an event handler? 
Add an OnMouseOver attribute to the button.
Example: btnSubmit.Attributes.Add(”onmouseover”,”someClientCodeHere();”).

Whats an assembly? 
Assemblies are the building blocks of .NET Framework applications; they form the fundamental unit of deployment, version control, reuse, activation scoping, and security permissions. An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. An assembly provides the common language runtime with the information it needs to be aware of type implementations. To the runtime, a type does not exist outside the context of an assembly.

Which property on a Combo Box do you set with a column name, prior to setting the DataSource, to display data in the combo box? 
DataTextField property.

How to dynamically change connection string in web.config? 
In web.config
<appsetting>
<add key =\”constr\” value =\”Persist Security Info=False;User ID=sa;password=sa;Initial Catalog=Database Name;Data Source=server Name\”/>
</appSettings>
in aspx page
string _constr;
_constr=ConfigurationManager.AppSettings[\"constr\"].ToString().

What is Flex-Grid in ASP.NET? 
In .net all data controls (GridView,Repeater,Datalist) are act like Flex grid.

What tags do you need to add within the asp:datagrid tags to bind columns manually?
Set AutoGenerateColumns Property to false on the datagrid tag.

What is the trace in ASP.NET? 
ASP.NET introduces new functionality that allows you to view diagnostic information about a single request for an ASP.NET page simply by enabling it for your page or application. Called tracing, this feature also allows you to write debug statements directly in your code without having to remove them from your application when it is deployed to production servers. You can write variables or structures in a page, assert whether a condition is met, or simply trace through the execution path of your page or application.  

What is delay signing? 
Delay signing allows you to place a shared assembly in the GAC by signing the assembly with just the public key. This allows the assembly to be signed with the private key at a later stage, when the development process is complete and the component or assembly is ready to be deployed. This process enables developers to work with shared assemblies as if they were strongly named, and it secures the private key of the signature from being accessed at different stages of development.

What is the use of AutoWireup in asp.net? 
AutoEventWireup attribute is used to set whether the events needs to be automatically generated or not.

What base class do all Web Forms inherit from? 
The Page class.

What property must you set, and what method must you call in your code, in order to bind the data from some data source to the Repeater control? 
You must set the DataSource property and call the DataBind method.

How to give hyperlink to a file in “asp net”? 
Use <a href=\”file:///hello.txt\”>Open file</a>

What are Codes Refactoring? 
It feature of Visual Web Express.Codes Refactoring Codes Refactoring enables we to easily and systematical makes changes to your code. Code Refactoring is support everywhere that you can writes codes including both code-behind and single-file ASP.NET pages. automatically promote a public field to a full property.

What is ASP.Net Web Matrix? 
This is a free ASP.NET development environment from Microsoft. As well as a GUI development environment, download includes simple web server that can be used instead of IIS to host ASP.NET apps. This opens up ASP.NET development to users of Windows XP Home Edition, which cannot run IIS.

What’s a strong name ? 
A strong name includes the name of the assembly, version number, culture identity, and a public key token.

What’s a bubbled event? 
When you have a complex control, like DataGrid, writing an event processing routine for each object (cell, button, row, etc.) is quite tedious. The controls can bubble up their eventhandlers, allowing the main DataGrid event handler to take care of its constituents.

What are the different types of sessions in ASP.Net? Name them? 
1.In Proc mode: stores session state in a web server by default.
2.State server mode: stores session state in a separate process called asp.net state services. Ensure that session state is preserved when web application is restarted and make session state available to multiple webservers within a web farm.
3.Sql server mode: stores session state in sql server database. State is preserved when application is restarted and available to multiple webservers.
4.Custom mode: enables you to store a custom session storage provider.
5.OFF mode: disable session state.

Difference between session and cookie? 
Cookies will set the same value for the variable or string throught the whole application when ever it is being run.But session sets or stores the value only till the time period when the application is running once if the application is closed the session value also willl become null.

Explain what a diffgram is? and a good use for one? 
The DiffGram is one of the two XML formats that you can use to render DataSet object contents to XML. For reading database data to an XML file to be sent to a Web Service.

Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process? 
inetinfo.exe is the Microsoft IIS server running, handling ASP.NET requests among other things.When an ASP.NET request is received (usually a file with .aspx extension),the ISAPI filter aspnet_isapi.dll takes care of it by passing the request tothe actual worker process aspnet_wp.exe. 

How to make Virtual Directory? 
Click “Start > settings> control Panel > Administrative Tools > internet information services”.Expand Internet Information Server. Expand the server name. In the left pane, right-click Default Web Site, point to New, and then click Virtual Directory. . In the first screen of the New Virtual Directory Wizard, type an alias, or name, for the virtual directory (site name), and then click Next. . In the second screen, click Browse. Locate the content folder that you created to hold the Web content. Click Next. In the third screen, click to select Read and Run scripts (such as ASP). Make sure that the other check boxes are cleared. Click Finish to complete the wizard.

Which method do you invoke on the DataAdapter control to load your generated dataset with data? 
The .Fill() method

Where are shared assemblies stored ? 
Global assembly cache.

Can I dynamically set the Image URL for Image Control? A)No B)Yes 
YES Why Not.
Hint: Use eval

How are you Write to XML File ? 
XmlTextWriter textWriter=new XmlTextWriter(’filename.xml’);
 
//WriteStartDocument and WriteEndDocument methods open and close a document for writing textWriter.WriteStartDocument()
//write comment text Writer. Write Comment(’this is my first xml file.’) textWriter.WriteComment(’i'm lovin it’) textWriter.WriteStartElement(’studentDB’) //

write first elementtextWriter.WriteStartElement(’student’) textWriter.WriteStartElement(’name’,”);
textWriter.WriteString(’sourabh’);
textWriter.WriteEndElement();
textWriter.WriterEndElement();
textWriter.WriteEndDocument();
textWriter.Close();
}

Whats the significance of Request.MapPath( ) ?
Maps the virtual path in the requested URL to a physical path on the server for the current request.

What type of code (server or client) is found in a Code-Behind class ? 
Server-side code.

How to connect asp.net with sql server ? 
It can be done through ADO.Net(Connected or Disconnected Architecture).

How long the value session variable has an effect when it not used by the program ? 
20 Minutes.

Where’s global assembly cache located on the system ? 
Usually C:\\winnt\\assembly or C:\\windows\\assembly.

Automatic Memory Management ? 
It’s entirely too easy for a small mistake to cause a program to chew up memory and crash, sometimes bringing the operating system to a screeching halt in the process. Programmers understand that they’re responsible for releasing any memory that they allocate, but they’re not very good at actually doing it. In addition, functions that allocate memory as a side effect abound in the Windows API and in the C runtime library. It’s nearly impossible for a programmer to know all of the rules. Even when the programmer follows the rules, a small memory leak in a support library can cause big problems if called enough. The .NET Framework solves the memory management problems by implementing a garbage collector that can keep track of allocated memory references and release the memory when it is no longer referenced. A large part of what makes this possible is the blazing speed of today’s processors. When you’re running a 2 GHz machine, it’s easy to spare a few cycles for memory management. Not that the garbage collector takes a huge number of cycles–it’s incredibly efficient. The garbage collector isn’t perfect and it doesn’t solve the problem of mis-managing other scarce resources (file handles, for example), but it relieves programmers from having to worry about a huge source of bugs that trips almost everybody up in other programming environments. On balance, automatic memory management is a huge win in almost every situation.

What is the base class of the .Net ? 
System.Object.

What technology is used to seperate the code from asp.net page ? 
Partial page class.

True or False: A Web service can only be written in .NET ? 
False

Which template must you provide, in order to display data in a Repeater control ? 
ItemTemplate.

Describe the difference between inline and code behind ?  
The main difference comes in that inline code is executed at a certain event level in the page lifecycle whether code-behind can be bounded to different levels of events (PreInit, Init, PreLoad, Load, DataBound, Unload, PreRender and so on)
Inline code written along side the html in a page. Code-behind is code written in a separate file and referenced by the .aspx page.

How can you tell the application to look for assemblies at the locations other than its own install ? 
Use the directive in the XML .config file for a given application.

Which control would you use if you needed to make sure the values in two different controls matched ? 
CompareValidator Control.

Define a transaction. What are acid properties of a transaction ? 
Transaction is a sequence of operation performed as single unit of work. The sequence in which the operation are performed have the importance.
ACID (Atomicity,Consistency,Isolation and Durability) properties of a transaction are as follows:
Atomicity : Either all the operation of the transaction must be completed successfully or none of the operation is done at all.
Consistency: Completion of transaction must have the data in a consistent state.
Isolation: Changes made current transaction must be isolated from any other transaction running simultaneously.
Durability : Once the transaction is complete, it;s changes must persist permanently in the system.

What is the Global.asax used for? 
The Global.asax (including the Global.asax.cs file) is used to implement application and session level events. It resides in the root directory of the application. The .asax file extension signals that it’s an application file rather than an ASP.NET file that uses aspx. The Global.asax file is the central point for ASP.NET applications. It provides numerous events to handle various application-wide tasks such as user authentication, application start up, and dealing with user sessions. You should be familiar with this optional file to build robust ASP.NET-based applications.

What property must you set, and what method must you call in your code, in order to bind the data from some data source to the Repeater control? 
You must set the DataSource property and call the DataBind method.

Does ASP.NET supports Linux Environment? 
Mono provides the necessary software to develop and run .NET client and server applications on Linux, Solaris,Mac OS X, Windows, and Unix. Sponsored by Novell, the Mono open source project has an active and enthusiasticcontributing community and is positioned to become the leading choice for development of Linux applications.

Name two properties common in every validation control? 
ControlToValidate property and Text property.

What is the importance of HTML in web applications? 
It is important.But now-a-days due to other languages its use is decreasing.Earlier it was highly used for all sites.

How to attach javascript code into asp.net code?
Inorder to use script in your asp.net page place the script under head tag of ur aspx source page like this:
<head>
<script type=\”text/javascript\”>

———————-

—————–(place the script components here)

————————

—————————
</script>
</head>
 
Call the script functions from any control events called \”onclick()\” or \”onclientclick()\”

How ASP .NET different from ASP? 
Difference between ASP and ASP.NET

ASP stands for Active Server Pages. ASP.NET is the next
generation of ASP. After the introduction of ASP.NET, old
ASP is called ‘Classic ASP’.

Classic ASP uses vb script for server side coding. Instead,
ASP.NET supports more languages including C#, VB.NET, J#
etc. VB.NET is very similar to vb script, so it should be
easy for old Visual Basic or ASP programmers to switch to
VB.NET and ASP.NET

VB Script is a simple scripting language, where as VB.NET
or C# are modern, very powerfull, object oriented
programming languages. Just for that reason, you will be
able to write much more robust and reliable programs in
ASP.NET compared to ASP.

In classic ASP, there was no server controls. You have to
write all html tags manually. ASP.NET offers a very rich
set of controls called Server Controls and Html Controls.
It is very easy to drag and drop any controls to a web
form. The VS.NET will automatically write the required HTML
tags automatically for you.

ASP is interpreted, ASP.NET is compiled.

What is difference between Webportal and website?
A Website is all the pages, images and files contained under a domain name - such as www.happy-online.co.uk
A Web Portal is a type of Website. A Web Portal acts as a gateway to the internet. (A typical dictionary definition of the word portal would be - a doorway or a grand entrance.)
Take the website www.yahoo.com, this is a website, all the pages under the domain www.yahoo.com combine to make the website. However, Yahoo is often referred to as a Web Portal, if you have a look at the Yahoo Website you can see why it has often been called a Portal. The Website acts as a doorway (Portal) to the Internet, from the website you can search the web, go shopping, take part in auctions, read your email etc.

Key differences in features of .NET 2.0 and 3.5? 
.NET 3.5 has more advanced feature than .NET 2.0.They are WCF, WPF, WCS,WF and LINQ

What is cache?
A temporary data storage location, or the process of storing data temporarily. A cache is typically used for quick data access.

How to connect to sql server using windows authentication in asp?
In <Connection string> of web config file:
Write:
\”server=servername;datasource=databaseName;IntegratedSecurity=true\”
Done

What is Remoting? 
Remoting i s communication between  computers which are connect to each other through lan.

What is the .net,why we use .net.what is the advantage to using .net other programming languages? 
.net is not a technology or language .It is an environment to develop an application either web/window/console based.
It provide the ability to achieve versioning.
Remove legacy/dependancy over os end the com based componet.
Can acheieve side by side exceution.

How can you tell the application to look for assemblies at the locations other than its own install? 
Use the directive in the XML .config file for a given application.

Should validation (did the user enter a real date) occur server-side or client-side? Why? 
Client-side. This reduces an additional request to the server to validate the users input.

Introduction to XML

October 8th, 2008

XML stands for Extensible Markup Language. XML can be used by anyone who is desirous of using web technologies to distribute information across the Internet or the intranet.

XML is another form of formatting a document with a web browser. XML is an powerful and effective tool for processing the contents of a document. In other words XML allows you to create your own tags. XML is a very simple and flexible markup language that can be used on any operating system or environment.

XML is also platform independent that is XML can run on any operating system. XML is a better form of describing the contents of a document to the user. XML allows the exchange of data on the web more easily and efficiently. XML does this by allowing the users to develop their own (DTD’s)

DTD’s are used for describing sets of tags and attributes to display the content in a desired format. XML vocabularies or applications are called as the individual markup language that is defined using DTD’s.

Genealogical Markup Language (GedML) and the Chemical Markup Language (CML) are the examples of XML vocabularies. GedML describe ancestral data and CML describes chemical formulas and molecules. XML is an extensive language that is not only used for describing data but is also used for describing metadata. Metadata means data about data. In a nutshell, XML is an effective method of describing data and Metadata that is platform independent and that it can be used on all operating systems.

XML is a subset of SGML. Its aim is to provide generic SGML to be served, received and processed on the web. XML has been designed for the interoperability with both SGML and HTML.

XML documents are made up of entities that are called as storage units. Some of them are parsed data and the others are unparsed data. XML enables a mechanism to provide constraints on the storage layout.

Is XML a database?
XML document is a collection of data. In other words it doesn’t make much difference between the other files that store data. A XML in a database format is a self describing, portable, and can describe data in tree or graph structure. XML is a sort of Database Management System (DBMS).

XML provides storage, schemas, query languages, programming interfaces and so on .It lacks in triggers, queries, multi-user access that a real database constitutes. The main advantage of XML is that the data is portable and it allows you to have nested entries.

XML allows you to preserve physical document structure, supports document level transactions and execute queries in an XML query language.

Mapping the XML document schema to the database schema does the transfer of data between XML documents and a database. Mappings between document schemas and database schemas are performed on attributes and text. There are 2 mappings that are generally used to map on XML document schema to the database schema:

1.TABLE BASED MAPPING
2.OBJECT RELATIONAL MAPPING

Native XML databases are designed especially to store XML documents .It is always possible to store data in XML documents in a native XML database. This is done so, when your data is semi-structured. Although, this kind of data can be stored in object oriented and hierarchical databases, it is always better to store it in a native XML database. It enables us to retrieve data much faster than a relational database. One more reason is to store data in a native XML database is to exploit XML specification capabilities, such as executing XML queries.

Using Stylesheets in XML
XML is a means of exchanging data between applications. It allows the developers to describe and structure their data in their own formats. As the XML gave more emphasis on data rather than formatting, the data in the XML document can be formatted in two ways:

1. USING CSS
2. USING XSL

Cascade Style Sheet( CSS):

Initially, Cascading Style sheets (CSS) were used for formatting the data in the XML documents. It allows the Web Developers to define a formatting for the elements in XML and the same can be applied to as many documents you like. The advantages are:

1.It has a Precise control over presentation
2.It is Resolution Independent
3.It downloads Faster
4.It is easy to maintain

Though it has a lot of advantages it also has following disadvantages.

1. The order of elements for display cannot be changed
2. An element cannot be processed more than once.
3. Generated text cannot be added to the presentation

USING eXtesible Stylesheet Language (XSL):

The difficulties that were encountered with CSS were removed by making use of XSL. XSL is an application of XML It allows you to create high performance XML based systems by integrating Server side XML processing’s. The need for transforming data from one format to the other results in splitting XSL into two groups:

i) XSLT – It describes how to transform XML. Document into other formats.
ii) XSL-FO- It describes formatting details of each element in the XML document.

i) XSLT:

The XML Style sheet Language Transformation (XSLT) is a mechanism of transforming one form of XML documents to the other form. It is a set of templates based on Xpath expressions that tells how to fetch a particular node from the XML documents. It is a part of XSL, which is a style sheet language for XML. XSLT is widely used in Websites Content Management to convert XML into HTML pages. It uses Xpath to define parts that match one or more templates. Xpath is an query language that allows you to identify the nodes. It can select nodes in any direction. An XSLT processor is used to perform transformations of XML document in to other formats based on the given XSLT document.

ii) XSL_FO:

XSL-FO means Extensible Formatting Objects. There are two different ways in which the XML document can be formatted. They are:

1. Layout Based formatting and 
2. Content Based formatting

In a layout based formatting, the limitations of the target may constrain the content or appearance on the page, whereas in a Content Based Formatting, the target medium is generated to accommodate the information being formatted. The XSL FO allows you to make formatting and styling options to your document.

Working with XML using ASP
The need for manipulating XML on the server increases as the need for XML increases.XML and ASP are a very efficient and a powerful combination.XML is a simple and a powerful tool for web developers.XML was created to handle complex Web documents. XML allows you to define all your own tags with rules such as data description and data relationships. XML is used in order to remove the cumbersome problems that were faced with HTML. Information can be accessed easier using XML. ASP and XML are powerful tools for creating dynamic web pages.

ASP uses XML as a tool in its application for a simple reason that data in HTML is allowed to transmit between dissimilar platforms, whereas XML allows us to express complex structure. Moreover it allows us to create our own tags with all sorts of rules. A new document instance can be created using MSXML.There are a number of ways to access XML data from an ASP page. Document Object Model (DOM) plays an important role in retrieving the XML data from ASP. In DOM a document is viewed as a tree of nodes. Every node of the tree can be accessed randomly. The main advantage is that it provides all functions in an Object based way.An XML parser based on DOM from Microsoft is MSXML.This component is used for accessing the XML documents.

There are two groups of DOM programming interfaces.The first group defines interfaces required for writing the application. The second group defines interfaces that are required to assist developers. Once the DOM Object is created on the server, your own XML document can be created. The XML document can be easily parsed on the server in an ASP and then the results can be sent to the client.

Accessing XML using Java Technologies
The most important benefit of XML is its simplicity. Though it is simple it is powerful enough to express complex data structures. Java is one of most important programming languages that is used for creating your web pages. It is an object oriented language whose main purpose was to be used with embedded systems such as cell phones. But later it gained more importance to be used with Web pages that were dynamic in nature. Java Applet and servelets are the important mechanisms for implementing this.

Another advantage of using Java is the concept of JavaBeans, which is a software component model for Java that allows the rapid development of an application by using a visual buider.DOM is one of the methods for accessing the structure of an XML document. An alternative is to use an event driven API.SAX is a simple API designed for XML.DocumentHandler is very important since it is called every time an element is found. A DocumentHandler is used as follows:

Step 1: Importing the parser interface
Step 2: Create an instance of SAX driver.
Step 3: Using this driver, create a parser object
Step 4: Register an instance of class MyHandler as a DocumentHandler.

JOX is a set of Java libraries that allows you to transfer data between XML documents and JavaBeans. JOX matches XML document to the fields of a bean and it will use a DTD when writing an XML document when one is available.JOX, unlike the other libraries, allows you to use any form of an XML document and any JavaBean without creating a separate schema to describe the mapping between Java and XML.

XP is an XML parser written in Java. The following are the advantages of XP:

1.XP is designed to be 100% conformant and correct
2.XP aims at High performance
3.Apart from the high level parser API, it also provides a low level API that supports the construction of different kinds of parser.

Breeze XML Binder is the most complete Java/XML data binding solution available. Breeze creates JavaBeans directly created from the XML structures.

XML Editor
XML editor allows you to take input and save files. XML editor is a text editor to create DTD’s and XML documents. Some editors check the XML documents whether it conforms to the rules of XML. The term XML EDITOR refers to the different types of tools depending on the purpose for which it is been used. There are a number of XML editors available in the market.

A few of the XML editors with their detailed descriptions are given below:

1.XMLmind XML Editor
The XML mind XML Editor (XXE) has been used with the word processor like view without the help of a tree view or visible tags. This allows concentrating more on content creation. XXE is a very efficient and powerful tree view that allows us to open XML documents for which CSS style sheet is not available. XXE helps in editing the XML data and document by embedding standard controls in the word processor like tree view. XMLmind XML Editor is easy to deploy and are highly extensible, which is a very indispensable feature that is more important than a word processor.

2.Peter’s XML Editor
The version 2.0 of this Peter’s XML Editor is a major development to this tool. The Peter’s XML editor uses a new XML parser, which is more powerful than previously used. The new tree view is much faster and powerful. The new source view allows the better editing of Unicode files.

3.VIM as XML Editor
It is a great and an extensible XML editor with many features. It is a highly efficient text XML editor built to enable text editing. VIM is called “PROGRAMMER’S EDITOR” and so it is useful programming that may consider it is an entire IDE. Not only for programmer’s, it is also perfect for all text editing.

4.oXygen XML Editor
This XML editor is a simple and elegant one combined with XML editing features, which has made it popular in both the corporate and academic worlds. The oXygen XML editor provides tools for document creation and presentation that can be validated against any user defined schema. The context sensitive editing minimizes the validation errors. The oXygen XML editor 4.0 provides a special layout when entering the debugging mode.

5.Exchanger XML Editor
This is a Java based XML Editor that enables easy browsing, managing and editing. It offers an extensive functionality to help XML authors, business analysis and software developers.

6.XML SPY EDITOR
Of all the XML editors, XML SPY tops as XML editor. It is a graphical schema editing and user interface that impresses the user with its versatility and power.

XML Parser
XML parser is a software module to read documents and a means to provide access to their content. XML parser generates a structured tree to return the results to the browser. An XML parser is similar to a processor that determines the structure and properties of the data. An XML parser can read a XML document to create an output to generate a display form.

There are a number of parsers available and a few of them are listed below:

1.The Xerces Java Parser
The main applications of the Xerces Java parser is the building up of the XML-savvy web servers
and to ensure the integrity of e-business data expressed in XML.

2.expat XML parser
The expat XML parser is written in C and runs on UNIX or W32.The expat XML parser is not a validating processor that is you can use it only to write an XML parser. This parser is contributed by James Clark.

3.XP and XT
XP is a Java based, XML validating parser and XT is an XSL processor. Both are written in Java.XP detects all non well formed documents. It gives high performance and aims to be the fastest conformant XML parser in Java. On the other hand XT is a set of tools for building program transformation systems. The tools include pretty printing; bundling of systems, tree transformation etc,

4.SAX
Simple API for XML (SAX) was developed by the members of a public mailing list (XML-DEV).It gives an event based approach to XML parsing. It means that instead of going from node to node, it goes from event to event. SAX is an event driven interface. Events include XML tag, detecting errors etc,

5.XML pull parser
It is optimal for applications that require fast and a small XML parser. It should be used when all the process has to be performed quickly and efficiently to input elements.

6.XML parser for Java
It runs on any platform where there is Java virtual machine. It is sometimes called XML4J.It has an interface which allows you to take a string of XML formatted text, pick the XML tags and use them to extract the tagged information.

XML RPC
XML RPC is a Remote Procedure Calling via the Internet. XML RPC is a network programming technique for making procedure calls on remote devices. Generally, XML RPC is used for developing Web services. XML RPC messages are the requests and the responses sent between the client and the servers. XML RPC is platform independent.

It is a message in the HTTP POST Request. The body of the Procedure is in XML and the value it returns is also in the form of an XML.It is designed as simple as possible but it allows complex data structures to be transmitted, analysed, and returned.

XML RPC is a protocol that allows different languages on different machines to communicate with each other. Since procedure requests and responses are in XML it is not necessary that each end of the RPC connection have to be written in the same language. XML RPC is the simplest tool that allows you to integrate even the most communicative tools. XML RPC can transport binary data as base64.

XML RPC has 8 datatypes. They are as follows:

1. INT
2. BOOLEAN
3. DOUBLE
4. STRING
5. BASE64
6. ARRAY
7. STRUCT
8. DATE/TIME

An array type is an indexed array and the STRUCT is a kind of associative array.
XML_RPC.NET is one of the libraries for XML RPC clients and services.

Listed below are few of its features:

1.Support for .NET on both Client and Server side.
2. Interface based definition of XML-RPC servers and clients
3. ASP.NET services that support both SOAP and XML RPC
4. Dynamic generation of documentation page at URL of XML-RPC
5. XML RPC.NET defines services as services running on the Microsoft IIS servers.

XML Schema
An XML Schema defines the elements, child elements and the attributes that can appear in a document. It can also define the order, the number of child elements, the data types for elements and attributes. In DBMS, Schema is a description of a database structure. Internal structures such as tables and fields can be defined using schemas. Schema defines tables and fields that make up the data. Schemas are defined using constraints.

There are two types of constraints:

1. CONTENT CONSTRAINTS
2. DATATYPE CONSTRAINTS

An XML schema is a set of schema components in which there are 13 kinds of grouped components under 3 categories primary, secondary and helper components.

The primary components include

  •  SIMPLE TYPE DEFINITIONS
  •  COMPLEX TYPE DEFINITIONS
  •  ATTRIBUTE TYPE DEFINITIONS
  •  ELEMENT DECLARATIONS

An XML schema consists of components such as type definitions and element declarations. They are used to access the validity of the well-formed element and attribute information items.
The purpose of XML schema structures schema describes a class of XML documents by using schemas components. Schemas provide specifications and additional information such as normalization and element values. Thus, XML schemas can be used to describe and catalogue XML documents. The XML schema validators allow us to check whether the instance of an document meets the requirements. The XML data can be described and validated using the XSD (XML Schema Editor). XSD is written in XML, so it doesn’t require a parser.

XML Tools
XML tools allows the developers to produce XML in a wide variety of situations such as comparing two documents, validating the XML documents, to check whether a file is well formed, etc., There are a lot of tools available, including those tools for creating and editing XML or building e-commerce applications.

A few of the tools are listed below:

1.Microsoft XML Diff and Patch
It is a set of tools that will allow you to compare two XML documents. It detects addition, deletion and detects the changes between two XML documents. It ignores order attributes, insignificant white spaces, and it doesn’t care about document coding. These tools if used on a structured data leads to suboptimal results, since they don’t have the capacity of recognizing the tree based structure.

2.XSD schema validator
This allows the validation of XML documents against an W3C XML schema or XML data reduced schema. It checks whether the given document is well formed and has a valid schema model.

3.Microsoft XSD interference 1.0
Allows you to create an XML schema definition language if a well formed XML file is available, then it generates an XSD that can validate that XML file.

4.XML CONTENT TOOLS
The XML content tools allow us to create edit and publish XML.The XML content tools were originally designed for publishing needs. XML pro from vervet logic is another relatively cheap and worth XML editing tool. The user interface helps you to make quick work.

5.XMetaL
XMetaL from SoftQuad is another affordable tool designed to make quick work of creating and editing files. It is a set of tools designed to simplify the implementation of XML applications. Two companies offer XML application tool kits. It enables you to deliver the contents in a short time to multiple channels, reduces complexity and cost of content. It supports DOM that includes extensive documentation. It also supports COM.

6.Breeze Commerce Studio
Bluestone software offers Breeze Commerce studio for creation of XML and Java based applications. It imports schema from XML DTD’s, XML documents and JDBC/ODBC databases.
It allows us to add data types and constraints to the elements of the schema.

7.Standalone and Single User content tools
Standalone, singleuser XML content tools are very cheap, since they require the least amount of development time and effort. If you have to handle XML creating, editing and publishing for print, web, investigate the product lines of Abortext and interleaf. RAD XML persistent tools are used for easy process, display and share complex data across applications with minimum coding.

8.Altova STYLEVISION 2004
Altova STYLEVISION 2004 is a new XML tool for web developers that provide extensive utilities for migrations. It is a visual editing tool that allows us to create style sheets and forms easily based on XML schemas or databases. It is a powerful database editing tool that allows you to generate reports directly from databases to XML.

9.Altova XML SPY2004
Altova XML SPY2004 Enterprise Edition is one of the most important XML tools for advanced application development. These tools have been used extensively for editing and working with XML technologies. It uses the Enhanced Grid View to manage elements or attribute creation.

10.XT
XT is a more powerful tool, which is easy to use .The understanding of the tree structure is made easy using XT, since the file you want to turn into a result tree is the name of the last parameter.
XT is easy to use if you are familiar with Java.

SOAP XML
Simple Object Access Protocol (SOAP) is a protocol that can be used for accessing the Web pages. SOAP or Simple Object Access Protocol is an XML based Object invocation Protocol. SOAP was developed for distributed applications to communicate through HTTP and firewalls. SOAP is platform independent and it uses XML and HTTP to access services, servers and objects.

SOAP consists of 3 parts:

1.SOAP ENVELOPE: Defines a framework for expressing what is in a message and who should handle it. The SOAP envelope namespace defines header and body element names and the encoding style.

2.SOAP ENCODING RULES: Defines a mechanism for exchanging instances of application defined data types. An encoding rule means an encoding style to know how it is applied to a specific data.

3.SOAP RPC: Defines a method to represent Remote Procedure Calls and responses. Soap RPC uses a request/response model for message exchanges. The request that is sent to the end point is the call and the response it sends represents the result of the call sent.

SOAP has the following features:

  • PROTOCOL independence
  • LANGUAGE independence
  • PLATFORM AND OS independence

SOAP is a way by which programs communicate with other programs using XML.SOAP uses XML to encapsulate data that needs to be sent to a remote subroutine. In more simple terms SOAP is a way by which Java objects and COM objects communicate with each other. A SOAP client is a program that creates an XML document that contains information required to invoke a method remotely in a distributed system.

A SOAP server is a code that listens to the SOAP messages and acts as a distributor and an interpreter. SOAP defines encoding rules called Base level codings. The encodings can be either

1.SIMPLE ENCODINGS
2.COMPOUND ENCODINGS

SIMPLE ENCODINGS are simple types like ints, floats, strings or user defined data types. These include data types such as arrays of bytes and Enumerations.

COMPOUND ENCODINGS include data types such as arrays and structures.

Voice XML
Voice XML is a concept based on XML that allows the access of Web Applications and content through phones. Speech based Telephone applications can be developed using Voice XML.

Document server allows the voice requests to be received from the interpreter and responds with Voice XML documents.

Voice XML Interpreter interprets the Voice XML documents that it receives from the document server.

Implementation Platform generates responses with respect to the user requests.

Voice XML depends greatly on the infrastructure of the Internet. Voice XML uses audio browser for input and output. The voice browser runs on the voice gateway, which is connected through Public Switched Telephone Network (PSTN).

Components of Voice XML:

1.DIALOGS:
There are two types of dialogs, Forms and Menus.

Forms collect input from the user just as in HTML where data is collected in the forms. Menus provide a list of options for the user to select from.

2.SESSION:
A Session begins once the user begins to interact with a voice XML document.

3.APPLICATION:
It is a collection of Voice XML Documents. All the documents in a particular application share the same root document.

4.GRAMMER:
It specifies the set of allowable vocabulary to be selected from the menu for the user to interact with the Voice XML document.

5.EVENTS:
If there are any semantics errors in the Voice XML document, the Voice XML interpreter throws the Events.

6.LINKS:
It specifies a transition that is common to all dialog boxes. If the user input matches the Grammar the link is transferred to the specified link’s destination.

XML Spy @2004 Tool
DTD’S and XML schemas are the very important concepts in framing the content model of an XML document. XML SPY@2004 is a very important tool that integrates both DTD’s and XML schemas with the editing XML schema documents. This means that the location of the definition of each element or attribute can be located using the “Go to Definition” command.

With XML SPY @2004 we can easily create XML schemas and Documents to automatically generate code in Multiple Programming languages thus saving time.

XML SPY supports both editing and Schema validation for the following Schema types:

1.Document Type Definitions (DTD)
2.Document Content Definitions (DCD)
3.XML Data Reduced (XDR)

XML SPY has four advanced views.

• Enhanced Grid View
• Database/Table view
• Text view
• Browser View

Enhanced Grid View is used for structure editing. Database/Table view displays the repeated entry in a tabular fashion; a text view with syntax coloring is used for Low level Work and a Browser View supports CSS and Style sheets.

One of the most important features of XML SPY is its integration with databases. This includes the import of table data and the import of table structure as XML schema. Other than MS-Access it also supports ODBC and OLEDB to access the other databases.

XSLT designer is one of the attractive tools that come with XML SPY. This Designer is a separate program that allows the loading of XML files .It then uses the Drag and Drop to build an HTML Document, generating an XSLT file. The resultant document can be viewed in the integrated preview and the Style Sheet can be saved as a XSLT file.

The Voice XML has the following Components:

1. Document Server
2. Voice XML interpreter
3. Implementation platform
 

 

 

 

 

 
 

 
 

Introduction to Visual Basic DotNet(VB.Net)

October 7th, 2008

Visual Basic.NET is modeled on the .NET framework. Therefore, along with the features of earlier versions of Visual Basic, Visual Basic.NET also inherits various features of the .NET framework. In this section, you will look at some of the new features in Visual Basic.NET that were unavailable in earlier versions of Visual Basic.Visual Basic.NET supports implementation inheritance in contrast to the earlier versions of Visual Basic that supported interface inheritance. In other words, with earlier versions of Visual Basic, you can only implement interfaces.

When you implement an interface in Visual Basic 6.0, you need to implement all the methods of the interface. Additionally, you need to rewrite the code each time you implement the interface. On the other hand, Visual Basic.NET supports implementation inheritance. This implies that, while creating applications in Visual Basic.NET, you can derive a class from another class, known as the base class. The derived class inherits all the methods and properties of the base class. In the derived class, you can either use the existing code of the base class or override the existing code. Therefore, with the help of implementation inheritance, code can be reused. Although a class in Visual Basic.NET can implement multiple interfaces, it can inherit from only one class.

Visual Basic.NET provides constructors and destructors. Constructors are used to initialize objects. In contrast, destructors are used to release the memory and resources used by destroyed objects. In Visual Basic.NET, the Sub New procedure replaces the Class_Initialize event. Unlike the Class_Initialize event available in earlier versions of Visual Basic, the Sub New procedure is executed when an object of the class is created. In addition, you cannot call the Sub New procedure. The Sub New procedure is the first procedure to be executed in a class. In Visual Basic.NET, the Sub Finalize procedure is available instead of the Class_Terminate event. The Sub Finalize procedure is used to complete the tasks that must be performed when an object is destroyed. The Sub Finalize procedure is called automatically when an object is destroyed.

Garbage collection is another new feature in Visual Basic.NET. The .NET framework monitors allocated resources such as objects and variables. In addition, the .NET framework automatically releases memory for reuse by destroying objects that are no longer in use. In Visual Basic 6.0, if you set an object to Nothing, the object is destroyed. In contrast, when an object is set to Nothing in Visual Basic.NET, it still occupies memory and uses other resources. However, the object is marked for garbage collection. Similarly, when an object is not referenced for a long period of time, it is marked for garbage collection. In Visual Basic.NET, the garbage collector checks for the objects that are not currently in use by applications. When the garbage collector comes across an object that is marked for garbage collection, it releases the memory occupied by the object. The garbage collector automatically handles the memory allocated to managed resources. However, you need to manage the memory allocated to unmanaged resources.

In the .NET framework, you can use the GC class, the Sub Finalize procedure, and the IDisposable interface to perform garbage collection operations for unmanaged resources. The GC class is present in the System namespace. It provides various methods that enable you to control the system garbage collector. The Sub Finalize procedure, which is a member of the Object class, acts as the destructor in the .NET framework. You can override the Sub Finalize procedure in your applications.
However, the Sub Finalize procedure is not executed when your application is executed. The GC class calls the Sub Finalize procedure to release memory occupied by a destroyed object. Thus, implementing the Sub Finalize procedure is an implicit way of managing resources. However, the .NET framework also provides an explicit way of managing resources in the form of the IDisposable interface. The IDisposable interface includes the Dispose method. After implementing the IDisposable interface, you can override the Dispose method in your applications. In the Dispose method, you can release resources and close database connections.Unlike earlier versions of Visual Basic, Visual Basic.NET supports overloading.
Overloading enables you to define multiple procedures with the same name, where each procedure has a different set of arguments. In addition to procedures, you can also use overloading for constructors and properties in a class. You need to use the Overloads keyword for overloading procedures. Consider a scenario in which you need to create a procedure that displays the address of an employee. You should be able to view the address of the employee based on either the employee name or the employee code. In such a situation, you can use an overloaded procedure. You will create two procedures.
Each procedure will have the same name but different arguments. The first procedure will take the employee name as the argument, and the second takes the employee code as the argument.The .NET framework class library is organized into namespaces. A namespace is a collection of classes. Namespaces are used to logically group classes within an assembly. These namespaces are available in all the .NET languages, including Visual Basic.NET.
In Visual Basic.NET, you must use the Imports statement to access the classes in namespaces.
For example, to use the button control defined in the System.Windows.Forms namespace, you must include the following statement at the beginning of your program:

Imports System.Windows.Forms

After adding the Imports statement, you can use the following code to create a new button:

Dim MyButton as Button

If you do not include the Imports statement in the program, however, you would need to use the full reference path of the class to create a button. If you didn’t include the Imports statement, you would use the following code to create a button:

Dim MyButton as System.Windows.Forms.Button

In addition to using the namespaces available in Visual Basic.NET, you can also create your own namespaces.Visual Basic.NET supports multithreading. An application that supports multithreading can handle multiple tasks simultaneously. You can use multithreading to decrease the time taken by an application to respond to user interaction. To do this, you must ensure that a separate thread in the application handles user interaction.

Visual Basic.NET supports structured exception handling, which enables you to detect and remove errors at runtime. In Visual Basic.NET, you need to use

Try…Catch…Finally statements to create exception handlers.
Using Try…Catch…Finally statements, you can create robust and effective exception handlers to improve the performance of your application.
 

Introduction to Visual Studio .NET

September 30th, 2008

Visual Studio.NET is based on the .NET framework.
Visual Studio.NET provides languages and tools that enable you to build Web-based, desktop, and mobile applications. You can also create Web services in Visual Studio.NET.

Visual Studio.NET includes the following programming languages:
1
. Visual Basic.NET
2. Visual C++.NET
3. Visual C#.NET
It also provides additional technologies, such as ASP.NET, that enable you to develop and deploy applications.In addition, Visual Studio.NET includes the MSDN library that contains documentation on various development  tools and applications.

Using the integrated development environment (IDE) of Visual Studio.NET, you can create applications in the various .NET languages. The IDE of Visual Studio.NET enables you to share tools and create applications in multiple languages.

Visual Studio.NET includes various enhancements over earlier versions of Visual Studio.

 New Features in Visual Basic :

Unlike Visual Basic 6.0, Visual Basic.NET is an object-oriented language.Visual Basic.NET supports the abstraction, encapsulation, inheritance, and polymorphism features.The earlier versions of Visual Basic, versions 4 through 6, supported interfaces but not implementation inheritance. Visual Basic.NET supports implementation inheritance as well as interfaces.Another new feature is overloading.In addition, Visual Basic.NET supports multithreading,which enables you to create multithreaded and scalable applications. Visual Basic.NET is also compliant with the common language specification (CLS) and supports structured exception handling.

Visual C# .NET
Visual Studio.NET provides a new language, Visual C#.NET, which is an object-oriented language based on the C and C++ languages. Using Visual C#.NET, you can create applications for the .NET framework. As mentioned earlier, Visual C#.NET supports the CLR, therefore, any code written in Visual C#.NET is managed code. The IDE provides various templates, designers, and wizards to help you create applications in Visual C#.NET.

Visual C++ .NET
Visual C++.NET is an enhanced version of Visual C++. Visual C++.NET includes features such as support for managed extensions and attributes.Managed extensions include a set of language extensions for C++ to enable you to create applications for the .NET framework. Using managed extensions, you can easily convert existing components to components that are compatible with the .NET framework. Therefore, with the help of managed extensions, you can reuse existing code and thus save both time and effort. In addition, by using managed extensions, you can combine both unmanaged and managed C++ code in an application.

The CLS is a set of rules and constructs that are supported by the CLR. Visual Basic.NET is a CLS-compliant language. Any objects, classes, or components that you create in Visual Basic.NET can be used in any other CLS-compliant language. In addition, you can use objects, classes, and components created in other CLScompliant languages in Visual Basic.NET. The use of the CLS ensures complete interoperability among applications, regardless of the language used to create the application. Therefore, while working in Visual Basic.NET, you can derive a class based on a class written in Visual C#.NET, and the data types and variables of the derived class will be compatible with those of the base class.

Visual C++.NET also supports attributes, which enable you to extend the functionality of the language and to simplify the creation of COM components. You can apply attributes to classes, data members, or member functions.

What are Web Forms ?
Visual Studio.NET introduces Web forms, which are based on Microsoft ASP.NET technology. Web forms are used to create Web pages. In Visual Studio.NET, you can drag controls to the designer and then add code to create Web pages. A Web forms page can open in any Web browser. The controls in a Web forms page are based on server-side logic.

What are Windows Forms ?
Windows forms provide a platform for developing Windows applications based on the .NET framework. Windows forms include a set of object-oriented and extensible classes that enable you to implement visual inheritance. Visual inheritance enables you to inherit a form from an existing form. Using these classes, you can develop Windows applications by creating a form based on an existing form. When you create forms based on existing forms, you can reuse code and thus enhance productivity. Typically,Windows forms are used to create user interfaces for a multitier application.

What are Web Services ?
Web services are applications that exchange data by using eXtensible Markup Language (XML). Web services can also receive requests over HTTP. Web services are not a part of any specific component technology. Therefore, any language or operating system can use Web Services. You can use Visual Basic.NET, Visual C#.NET, or ATL Server to create Web services.

XML(Extensible Markup Language)

XML is a markup language based on Standard Generalized Markup Language (SGML), which is a standard for all markup languages. XML is a subset of SGML. XML enables you to define the structure of data by using markup tags. In addition, you can also define new tags using XML.The World Wide Web Consortium (W3C) has defined XML standards to ensure that structured data is uniform and independent of applications.

Visual Studio.NET it also provides XML Designer, which enables you to create and edit XML documents and create XML schemas.

Visual Studio C#

September 24th, 2008

Microsoft Visual C# 2005 is an object-oriented programming language used to develop applications targeting the .NET environment. Each language includes rules that describe proper syntax and structure; we use these rules to convey cohesive thoughts and ideas. Programming languages includes rules for proper syntax and structure and often evolve from other languages.The key elements of C# are symbols and tokens, keywords, expressions, statements, functions, and classes. C# is an object-oriented language, not a procedural language (more on this difference later). C#, C++, Java, SmallTalk, Eiffel, and other object-oriented languages are only as effective as your appreciation of object-oriented concepts and programming techniques.

C# Origin

From the time when the first natural language appeared, hundreds of thousands of languages have emerged. Many of these languages are now extinct, leaving about six thousand languages that are currently spoken. Some of these languages are similar and grouped by classification. Other languages are quite distinct, such as Kora, which incorporates a series of click sounds and is spoken by bushmen in Africa.

A list of programming languages is modest when compared with the catalogue of natural languages. Beginning in the 1940s with Plankalkül, more than 1,000 programming languages have been documented. Like natural languages, the variety and diversity of these languages is impressive: the succinctness of assembler, the verbosity of COBOL, and the efficiency of C. For a comprehensive list of programming languages, visit this link: http://oop.rosweb.ru/Other/.

The motivations that inspire the creation of languages are diverse: FORTRAN was created for scientific analysis, COBOL for building business applications, RPG for report generation, and so on. Some languages serve as refinements of earlier languages. CPL combined the best ingredients of several languages, including ALGOL, FORTRAN, and COBOL. C# is an independently developed, object-oriented language and a member of the C family of languages. It shares similar syntax and some concepts with other C-family languages; more important, however, C# has few if any vestiges of procedural programming, in which the basic programming element is the procedure (that is, a named sequence of statements, such as a routine, subroutine, or function). Unfortunately, C++ inherited many of the artifacts of procedural programming from C. C#, however, was designed to be a purely object-oriented language.

ALGOL is arguably the most influential programming language in history. The language was introduced in 1958 but became popular when ALGOL-60 was released in 1960. ALGOL quickly became the dominant language in Europe during the 1960s. Its impact on future languages such as Pascal, C, and Java is undeniable—these languages’ grammatical syntax borrows heavily from ALGOL. I’ve programmed professionally in ALGOL, assembler, COBOL, FORTRAN, C, C++, C#, Basic (in various renditions), Forth, JavaScript, HTML, XML, MISL, and many more—and ALGOL remains my favorite language. The major design goals of ALGOL were portability, a formal grammar, and support for algorithms. ALGOL-68 extended the language, but the additions increased complexity and furthered abstraction from hardware. This abstraction prevented developers from easily accessing devices and the lower tiers of the operating environment. Soon, languages were introduced that were less complex and not as abstracted from the architecture. One of these new languages was C.

The journey from ALGOL to C began with CPL. CPL, a derivative of ALGOL-60, was developed at the Computer Lab of Cambridge University. CPL was created in 1963 by David Barron, Christopher Strachey, and Martin Richards. Although CPL is not as abstracted as ALGOL, it did maintain one characteristic of ALGOL: complexity. Martin Richards introduced Basic CPL (BCPL) in 1967 as a lean version of CPL. Ken Thompson of Bell Labs drafted B in 1970 as the successor to BCPL. B was lighter, faster, and more appropriate for systems programming. C was developed by Dennis Ritchie, also of Bell Labs, in 1972. C returned some of the abstraction removed from B while keeping that language simple and quick. Although initially consigned to the UNIX operation system and systems programming, C is a general-purpose language and has been used for a diverse assortment of applications across a variety of platforms and operating systems.

FORTAN, ALGOL, and COBOL dominated the procedural programming landscape in the 1960s. On a separate track, Simula was created between 1962 and 1965 by Ole-Johan Dahl and Kristen Nygaard at the Norwegian Computing Center. Simula is notable for being the first object-oriented programming (OOP) language. It was designed for simulation, but evolved into a general-purpose language. Simula introduced the important OOP concepts of classes, inheritance, and dynamic binding.

Combining aspects of C and Simula, Bjarne Stroustrup introduced C with Classes in 1979 as an enhancement of the C programming language. Later, under Stroustrup’s stewardship, C++ was created as a direct descendant of C with Classes and was publicly recognized in 1983. C++ rapidly became the premier object-oriented programming language and introduced structured exception handling, templates, and much more.

C# premiered at the Professional Developers Conference (PDC) held in Orlando, Florida, in 2000. The primary architects of C# were Anders Hejlsberg, Scott Wiltamuth, Peter Sollichy, Eric Gunnerson, and Peter Golde. C# was designed to be a fully object-oriented language focusing on developing components in a distributed environment and was launched as part of a larger initiative by Microsoft called Microsoft .NET. Underscoring the importance of .NET to Microsoft, Bill Gates was the keynote speaker at the PDC that year. I attended the PDC in 2000 and was both intrigued and motivated by the introduction of .NET and C#. .NET is emblematic of a philosophical change at Microsoft and an embracing of the standards community.

Both .NET, as defined by the Common Language Infrastructure (CLI), and C# were submitted to two international standards organizations: ECMA and ISO/IEC. Also, .NET and .NET languages, described in the Common Language Specification (CLS), continue the trend toward truly portable code. You can write an application in one environment and run it anywhere else. Simultaneously, a new version of Microsoft Visual Studio was announced: Visual Studio .NET. Visual Studio .NET provides rapid application development tools for developing a wide variety of .NET applications.

Object-Oriented Programming

Windows and web programs are enormously complex. Programs present information to users in graphically rich ways, offering complicated user interfaces, complete with drop-down and pop-up menus, buttons, listboxes, and so forth. Behind these interfaces, programs model complex business relationships, such as those among customers, products, orders, and inventory. You can interact with such a program in hundreds if not thousands of different ways, and the program must respond appropriately every time.

To manage this enormous complexity, programmers have developed a technique called object-oriented programming. It is based on a very simple premise: you manage complexity by modeling its essential aspects. The closer your program models the problem you are trying to solve, the easier it is to understand (and thus to write and to maintain) that program.

Programmers refer to the problem you are trying to solve and all the information you know that relates to your problem as the problem domain. For example, if you are writing a program to manage the inventory and sales of a company, the problem domain would include everything you know about how the company acquires and manages inventory, makes sales, handles the income from sales, tracks sales figures, and so forth. The sales manager and the stock room manager would be problem domain experts who can help you understand the problem domain.

A well-designed object-oriented program is filled with objects from the problem domain. At the first level of design, you’ll think about how these objects interact and what their state, capabilities, and responsibilities are.

 

Online Dot Net Books

August 9th, 2008

Dot Net Interview Questions

July 30th, 2008

What is .NET?
.NET is essentially a framework for software development. It is similar in nature to any other software development framework (J2EE etc) in that it provides a set of runtime containers/capabilities, and a rich set of pre-built functionality in the form of class libraries and APIs
The .NET Framework is an environment for building, deploying, and running Web Services and other applications. It consists of three main parts: the Common Language Runtime, the Framework classes, and ASP.NET.

With respect to security ,which one is the better choice .Net or J2EE? Explain?
The dot net is more secure than J2EE,because .net is having multiple modules compatible with it.All modules are depends upon each other to functions.As .net is more comfortable that provides more security for users and Data with Application. 

 How many languages .NET is supporting now?
When .NET was introduced it came with several languages. VB.NET, C#, COBOL and Perl, etc. The site DotNetLanguages.Net says 44 languages are supported.

How is .NET able to support multiple languages?
A language should comply with the Common Language Runtime standard to become a .NET language. In .NET, code is compiled to Microsoft Intermediate Language (MSIL for short). This is called as Managed Code. This Managed code is run in .NET environment. So after compilation to this IL the language is not a barrier. A code can call or use a function written in another language.
 
How ASP .NET different from ASP?
Scripting is separated from the HTML, Code is compiled as a DLL, these DLLs can be executed on the server.

What is smart navigation?
The cursor position is maintained when the page gets refreshed due to the server side validation and the page gets refreshed.

What is view state?
The web is stateless. But in ASP.NET, the state of a page is maintained in the in the page itself automatically. How? The values are encrypted and saved in hidden controls. this is done automatically by the ASP.NET. This can be switched off / on for a single control.

How do you validate the controls in an ASP .NET page?
Using special validation controls that are meant for this. We have Range Validator, Email Validator.
Can the validation be done in the server side? Or this can be done only in the Client side?
 Client side is done by default. Server side validation is also possible. We can switch off the client side and server side can be done.

How to manage pagination in a page?
Using pagination option in DataGrid control. We have to set the number of records for a page, then it takes care of pagination by itself.

What is ADO .NET and what is difference between ADO and ADO.NET?
ADO.NET is stateless mechanism. I can treat the ADO.Net as a separate in-memory database where in I can use relationships between the tables and select insert and updates to the database. I can update the actual database as a batch.

Observations between VB.NET and VC#.NET?
Choosing a programming language depends on your language experience and the scope of the application you are building. While small applications are often created using only one language, it is not uncommon to develop large applications using multiple languages.

For example, if you are extending an application with existing XML Web services, you might use a scripting language with little or no programming effort. For client-server applications, you would probably choose the single language you are most comfortable with for the entire application. For new enterprise applications, where large teams of developers create components and services for deployment across multiple remote sites, the best choice might be to use several languages depending on developer skills and long-term maintenance expectations.

The .NET Platform programming languages - including Visual Basic .NET, Visual C#, and Visual C++ with managed extensions, and many other programming languages from various vendors - use .NET Framework services and features through a common set of unified classes. The .NET unified classes provide a consistent method of accessing the platform’s functionality. If you learn to use the class library, you will find that all tasks follow the same uniform architecture. You no longer need to learn and master different API architectures to write your applications.

In most situations, you can effectively use all of the Microsoft programming languages. Nevertheless, each programming language has its relative strengths and you will want to understand the features unique to each language. The following sections will help you choose the right programming language for your application.

How u can create XML file?
To write Dataset Contents out to disk as an XML file use:

MyDataset.WriteXML(server.MapPath(”MyXMLFile.xml”))
dataSet.WriteXml(string path);

Can we run DOT.NET in unix plateform?
One of the disadvantages of using Visual Studio.NET and the .NET framework to develop applications has been the lack of cross-platform support. Since the introduction of the .NET framework and common language run time a few years ago, there have been a few projects designed to bring the .NET framework to other platforms, including Linux and Unix.The DotGNU project is touted as the “Free software alternative to .NET” and encompasses a number of projects, including DotGNU Portable .NET, which is designed to be used to compile and run C# and C applications on a multitude of platforms, including GNU/Linux, FreeBSD, Mac OS X, and Windows.One of the main features of the product is it’s compatibility with EMCA standards for C# and the Common Language Infrastructure (CLI), as well as Microsoft’s own CLI implementation in the .NET framework.The project chose to go with a “Virtual Machine” implementation, where bytecode is transformed into a simple instruction set which is then passed to a “Converted Virtual Machine”, which then are executed through an interpreter. This approach is different to other open source .NET implementations, but provides more flexibility when porting the project to other platforms.At the core of the project is the runtime engine (ilrun) and compiler (cscc) with an implementation of System.Windows.Forms that make developing for the platform easier, as it doesn’t required translation through another toolkit or toolset.

How will you make .NET programs work in Linux ?
Mono provides the necessary software to develop and run .NET client and server applications on Linux, Solaris, Mac OS X, Windows, and Unix. Sponsored by Novell, the Mono open source project has an active and enthusiastic contributing community and is positioned to become the leading choice for development of Linux applications.

What is the difference between the C#.NET and VB.NET?
VB.NET

- It didn’t have the XML Documentation.

- It didn’t have the Operator Overloading.

- It didn’t have the Pointer Type variables.

C#.NET

- It has XML Documentation, Operator Overloading and supports Pointer Variables using unsafe keyword
c#.net is case sensitive.
vb.net is not case sensitive

Can implement same method name in both base class And derived class with different action?
Method overloading is possible.

suppose baseclass class class1 is having method called getname(string name) this method can be overloaded in derived class class2:class1

{

void getmethod(int i,string name)

{

}

}

It is possible with Method over riding not with over loading.
over loading is required with in the same class. but with in base class and child class over riding is possible.

Can I change private assembly to shared assembly?How?
Yes, You can change from Private to Shared.

- Get the SN using sn.exe

- Add the SN to the Assembly

- Put the Assembly in GAC.
Yes You can change.

In .NET Compact Framework, can I free memory explicitly without waiting for garbage collector to free the memory?
Yes, the memory can be cleared using gc.collect method but it is recommanded that u should not call this because we don’t know the exact time when the gc will be called automaticle.

What i do for load testing in . net application?
Load testing for .NET Developers and testersBy Red Gate Software.

How many types of assemblies are there , wat are they?
A private assembly is normally used by a single application, and is stored in the application’s directory. A shared assembly is normally stored in the global assembly cache, which is a repository of assemblies maintained by the .NET runtime. Satellite assemblies are often used to deploy language-specific resources for an application. These language-specific assemblies work in side-by-side execution because the application has a separate product ID for each language and installs satellite assemblies in a language-specific subdirectory for each language.

How to clear a datagrid on a button click?
You need to Clear the DataSource of the dadaGrid.

So try this codes:

dataSet1.Clear();

dataGrid1.DataSource = dataSet1.TableNameHere.DefaultView;

or

C#: dataGrid1.DataSource = null;

VB: dataGrid1.DataSource = nothing
Given a server with 4 cpu’s, and no databases write a pseudocode to search for the word camera in 100,000 html documents?
Start 4 threads which do the following task:
Opens every nth file (first thread will open 0th, 4th, 8th, 12th file, second thread will open 1st, 5th, 9th and so on)
Scans the file for occurrences of word ‘camera’ and notes down line numbers (possibly in a hash table — the key would be the file name with complete path and value will be an array / arraylist containing line numbers).

What Is The Difference Between ViewState and SessionState?
ViewState persist the values of controls of particular page in the client (browser) when post back operation done. When user requests another page previous page data no longer available.

SessionState persist the data of particular user in the server. This data available till user close the browser or session time completes.

How different are interface and abstract class in .Net?
Abstract classes can not be instantiated it can have or cannot have abstract method basically known as mustinherit as the methods are static in nature where interfaces are the declaration and r defined where they are called used for dynamic methods.
Interface needs to be implemented,abstract class has build in implementation.

What is the difference between proc. sent BY VAL and By Ref?
BY VAL: changes will not be reflected back to the variable.
By REF: changes will be reflected back to that variable.( same as & symbol in C,C++).

Which control cannot be placed in MDI?
All the controls that cannot be placed on the MDI. Only certain controls can be pleced on the MDI they are Picture Box, Tool Strip, Status Bar, Timer, Progressvie Bar.

Dotnet Page Lifecycle? 
While excuting the page, it will go under the fallowing steps(or fires the events) which collectivly known as Page Life cycle. Page_Init — Page Initialization LoadViewState — View State Loading LoadPostData — Postback data processing Page_Load — Page Loading RaisePostDataChangedEvent — PostBack Change Notification RaisePostBackEvent — PostBack Event Handling Page_PreRender — Page Pre Rendering Phase SaveViewState — View State Saving Page_Render — Page Rendering Page_UnLoad — Page Unloading.  

What is the difference between visual basic and visual basic dot net?
VB.NET is Microsoft’s Visual Basic implemented onto their .NET Framework. While Visual Basic is part of Visual Studio, VB.NET is also part of the Visual Studio.NET release.

What is the difference between SQL Server, Visual Studio, ASP.NET and Visual Basic?
SQL Server is a RDMS (Relational Database Management System). Visual Studio is the IDE (Integrated Development Environment) development studio that encompasses the Microsoft programming languages. ASP.net is scripting for IIS (Internet Information Server) using the .Net platform. Visual Basic is a Microsoft programming language, and part of Visual Studio.

 

Dot Net Jobs for Experienced

July 25th, 2008

Trainer/Faculty for Dotnet,Java,Mainframes,Oracle9i,As/400,SAP FICO,SD (0-4 yrs.),28 July 2008
High Technologies Solutions
Location : Delhi/NCR
We have a opening in High Technologies solutions for full-time/Part time Trainer/Faculty. He would be responsible for giving training to the IT Freshers or professionals We are also looking….

Software Engineer - C# .net ( Windows Based Application)  (2 - 4 yrs), 25 July 2008
  Scicom Technologies Pvt. Ltd.
  Location : Noida
  Skills Set: Hands on experience on C#, .Net (Windows Application) Good knowledge of SQL or Oracle as a database…..

 Sr. Software engineer  (4-6 yrs), 24 July 2008
  Q3 Technologies, Inc 
  Location : Gurgaon 
  This is a hands-on role for a detail oriented individual who will coordinate, facilitate, provide technical direction and participate in the  the development of business applications…..

Sr. Engineer / Technical Desinger (VC++) - Pune (2-7yrs),23 July 2008
  Patni Computer Systems Ltd
  Location : Pune
  Project/Team Management, Application Development and architecture design, Resource allocation & management, team building, project designing,….

 Lead Engineer-JIT Compiler expert  (3-5yrs), 22 July 2008
  Samsung India Electronics Ltd 
  Location : Delhi 
  Specialist in field. Provide thought and technical leadership to other engineers. Responsible for high and low level software design, implementation…..

Software Develper - .Net Compact Framework  (3-5yrs), 21 July 2008
  Q3 Technologies 
  Location : Gurgaon
  This is a hands-on role for a detail oriented individual who will coordinate, facilitate, provide technical direction and participate in the…..