0% found this document useful (0 votes)
74 views10 pages

Interview Questions

The document contains questions and answers related to .NET development. It discusses topics like the Common Language Runtime (CLR), Common Type System (CTS), differences between ViewState and SessionState, advantages of VB.NET, controls that don't have events, deep copying in .NET, assemblies, differences between a.Equals(b) and a == b, turning off cookies for a single page, whether a web service must be written in .NET, the root class in .NET, issues with catching all exceptions, creating XML files, controls that cannot be used in MDI, strong names, differences between ADO and ADO.NET, and the purpose of the Web.config file.

Uploaded by

Samatha Madadi
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views10 pages

Interview Questions

The document contains questions and answers related to .NET development. It discusses topics like the Common Language Runtime (CLR), Common Type System (CTS), differences between ViewState and SessionState, advantages of VB.NET, controls that don't have events, deep copying in .NET, assemblies, differences between a.Equals(b) and a == b, turning off cookies for a single page, whether a web service must be written in .NET, the root class in .NET, issues with catching all exceptions, creating XML files, controls that cannot be used in MDI, strong names, differences between ADO and ADO.NET, and the purpose of the Web.config file.

Uploaded by

Samatha Madadi
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Observations between VB.NET and VC#.NET?

View Answer

What is CLR? View Answer

What is "Common Type System" (CTS)? View Answer

What Is The Difference Between ViewState and SessionState? View Answer

Advantages of VB.NET? View Answer

Which controls do not have events? View Answer

How would one do a deep copy in .NET? View Answer

What is cts and cls? View Answer

What are Assemblies? View Answer

What is the difference between a.Equals(b) and a == b? View Answer

How do you turn off cookies for one page in your site? View Answer

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

What is the root class in .Net ? View Answer

Why is catch(Exception) almost always a bad idea? View Answer

How u can create XML file? View Answer

Which control cannot be placed in MDI? View Answer

What is a Strong Name? View Answer

What is the difference between ADO and ADO.NET? View Answer

What is Web.config? View Answer

What are the advantages and drawbacks of using ADO.NET?


Q: Observations between VB.NET and VC#.NET

Answers: 
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.

Visual Basic .NET


Visual Basic .NET is the next generation of the Visual Basic language from Microsoft. With
Visual Basic you can build .NET applications, including Web services and ASP.NET Web
applications, quickly and easily. Applications made with Visual Basic are built on the services
of the common language runtime and take advantage of the
.NET Framework.

Visual Basic has many new and improved features such as inheritance, interfaces, and
overloading that make it a powerful object-oriented programming language. Other new
language features include free threading and structured exception handling. Visual Basic fully
integrates the .NET Framework and the common language runtime, which together provide
language interoperability, garbage collection, enhanced security, and improved versioning
support. A Visual Basic support single inheritance and creates
Microsoft intermediate language (MSIL) as input to native code compilers.
Visual Basic is comparatively easy to learn and use, and Visual Basic has become the
programming language of choice for hundreds of thousands of developers over the past
decade. An understanding of Visual Basic can be leveraged in a variety of ways, such as
writing macros in Visual Studio and providing programmability in
applications such as Microsoft Excel, Access, and Word.
Visual Basic provides prototypes of some common project types, including:

? Windows Application.

? Class Library

? Windows Control Library.

? ASP.NET Web Application.

? ASP.NET Web Service.


? Web Control Library.

? Console Application.

? Windows Service.

? Windows Service.

Visual C# .NET

Visual C# (pronounced C sharp) is designed to be a fast and easy way to create .NET
applications, including Web services and ASP.NET Web applications. Applications written in
Visual C# are built on the services of the common language runtime and take full advantage
of the .NET Framework.

C# is a simple, elegant, type-safe, object-oriented language recently developed by Microsoft


for building a wide range of applications. Anyone familiar with C and similar languages will
find few problems in adapting to C#. C# is designed to bring rapid development to the C++
programmer without sacrificing the power and control that are a
hallmark of C and C++. Because of this heritage, C# has a high degree of fidelity with C and
C++, and developers familiar with these languages can quickly become productive in C#. C#
provides intrinsic code trust mechanisms for a high level of security, garbage collection, and
type safety. C# supports single inheritance and creates Microsoft intermediate language
(MSIL) as input to native code compilers.

C# is fully integrated with the .NET Framework and the common language runtime, which
together provide language interoperability, garbage collection, enhanced security, and
improved versioning support. C# simplifies and modernizes some of the more complex
aspects of C and C++, notably namespaces, classes, enumerations,
overloading, and structured exception handling. C# also eliminates C and C++ features such
as macros, multiple inheritance, and virtual base classes. For current C++ developers, C#
provides a powerful, high-productivity language alternative.
Visual C# provides prototypes of some common project types, including:

? Windows Application.

? Class Library.

? Windows Control Library.

? ASP.NET Web Application.

? ASP.NET Web Service.

? Web Control Library.

? Console Application.

? Windows Service.
What is CLR?

CLR is .NET equivalent of Java Virtual Machine (JVM). It is the runtime that converts a
MSIL code into the host machine language code, which is then executed appropriately. The
CLR is the execution engine for .NET Framework applications. It provides a number of
services, including: 

? Code management (loading and execution)

? Application memory isolation

? Verification of type safety

? Conversion of IL to native code

? Access to metadata (enhanced type information)


? Managing memory for managed objects

? Enforcement of code access security

? Exception handling, including cross-language exceptions

? Interoperation between managed code, COM objects, and pre-existing DLL's (unmanaged
code and data)

? Automation of object layout

? Support for developer services (profiling, debugging, and so on).

What is Common Type System?

The common type system defines how types are declared, used, and managed in the
runtime, and is also an important part of the runtime's support for cross-language
integration. The common type system performs the following functions: 

Establishes a framework that helps enable cross-language integration, type safety, and high
performance code execution. Provides an object-oriented model that supports the complete
implementation of many programming languages. Defines rules that languages must
follow, which helps ensure that objects written in different languages can interact with each
other.

What is the Difference Between View State and Session State?

View state & session state are objects which are used for maintaining a state.
but view state maintains a state in a single page. if we go to another page the state will be
lossed. But session state we can maintain a state as long as browser opened or session time
expired.
What is the root class in ..NET?

System. object is the root class in .net


Well, if at that point you know that an error has occurred, then why not write the proper code
to handle that error instead of passing a new Exception object to the catch block? Throwing
your own exceptions signifies some design flaws in the project.

What is the difference between ADO and ADO.NET?

ADO
1. This object model could be used even for non RDBMS products. We can read data from
xml excel csv files also.

2. ADO objects are dependent on OLEDB providers and OLEDB providers would connect to
the back end.

3. Fully COM based.

ADO.NET
1. It is not an enhanced version of ADO. Its a new object model which has some objects
similar to ADO.

2.In ADO.NET we use Managed Providers.


What is Web.config File?

In classic ASP all Web site related information was stored in the metadata of IIS. This had the
disadvantage that remote Web developers couldn't easily make Web-
site configuration changes. For example, if you want to add a custom 404 error page, a setting
needs to be made through the IIS admin tool, and you're Web host will likely
charge you a flat fee to do this for you. With ASP.NET, however, these settings are moved
into an XML-formatted text file (Web.config) that resides in the Web site's root directory.
Through Web.config you can specify settings like custom 404 error pages, authentication and
authorization settings for the Web site implication options for the ASP.NET Web pages, if
tracing should be enabled, etc.

The Web.config file is an XML-formatted file. At the root level is the <configuration> tag.
Inside this tag you can add a number of other tags, the most common and useful one being the
system.web tag, where you will specify most of the Web site configuration parameters.
However, to specify application-wide settings you use the

<appSettings> tag

.
For example, if we wanted to add a database connection string parameter we could have a
Web.config file like so:

<configuration>
<!-- application specific settings -->
<appSettings>
<add key="connString" value="connection string" />

</appSettings>
<system.web>
...
</system.web>
</configuration>
Now, in any of your ASP.NET Web pages in this Web site you can read the value of the
connString parameter like so:

ConfigurationSettings.AppSettings("connString")
To avoid this complication you can "group" your application's settingsinto a unique tag in the
Web.config file. That is, you can create a tag named: <MyAppSettings> in Web.config and
then use the as we did earlier to add application-wide settings. To add a custom tag to
Web.config you need to first explicitly specify the new tag name in Web.config via the
<configSections> tag, like so:

<configuration>
<configSections>
<section name="MyAppSettings"

type="System.Configuration.NameValueFileSectionHandler,
System, Version=1.0.3300.0, Culture=neutral,

PublicKeyToken=b77a5c561934e089" />

</configSections>
...
</configuration>
This <section ... /> tag indicates that we are going to be adding a custom tag named
MyAppSettings. Now we can add a <MyAppSettings> tag to our Web.config file and
add <add ... /> tags to add application-wide parameters, like so:
<configuration>
<configSections>
<section name="MyAppSettings"

type="System.Configuration.NameValueFileSectionHandler,
System, Version=1.0.3300.0, Culture=neutral,

PublicKeyToken=b77a5c561934e089" />

</configSections>
<MyAppSettings>
<add key="connString" value="connection string" />

</MyAppSettings>
...
</configuration>
To read this custom value from an ASP.NET Web page we use the following syntax:
ConfigurationSettings.GetConfig("MyAppSettings")("connString")

Web.con fig file is a collection of settings.


like 
database.
session state.
error handling
security.
if u want to do any change we can perform here so it reflect to entire project.

Example:
we develop a project for a company, that company shifted a new place so address is changed.
In this time what we do simply changes in web.config file.

You might also like