Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
in
INDEX
1. C#
2. ASP.NET/ADO.NET
3. IIS
4. ASP2
5. SQL
6. XML and WebServices
7. COM/DCOM
8. .Net Framework
9. UML
ASP.NET/ADO.NET Top
Server.Transfer: End the current Web form and begin executing a new Web form. This method
works only when navigating to a Web Forms page (.aspx).
Server.Execute: Begin executing a new Web form while still displaying the current Web form.
The contents of both forms are combined. This method works only when navigating to a Web
Forms page (.aspx).
Exceptions are unusual occurrences that happen within the logic of an application. Errors that are
not dealt with in code are called unhandled exceptions. Use GetLastError to get the last exception
value. There are three approaches to handling exceptions in a Web application:
• Use exception-handling structures to deal with exceptions within the scope of a procedure.
This technique is called structured exception handling (SEH) in the Visual Studio .NET
documentation. Use Try, Catch and Finally to handle Exceptions. Finally block is always
executed. If an exception occurs in the “Finally" block then it becomes an Unhandled Exception.
• Use error events to deal with exceptions within the scope of an object. Error events let you
handle exceptions for an entire object in a single, centralized location--the error event procedure.
o Page_Error: An unhandled exception occurs on the page. This event procedure resides in the
Web form.
o Global_Error: An unhandled exception occurs in the application. This event procedure resides
in the Global.asax file.
• Use custom error pages to display informational messages for unhandled exceptions within
the scope of a Web application
o Specify application-wide error page settings in the customErrors section of the Web.config
file.
o Specify an error page for a specific Web form in the ErrorPage attribute of the Web form's @
Page directive.
Page_Init: The server controls are loaded and initialized from the Web form's view state. This is
the first step in a Web form's life cycle.
Page_Load: The server controls are loaded in the Page object. View state information is
available at this point, so this is where you put code to change control settings or display text on
the page.
Page_Disposed: The Page object is released from memory. This is the last event in the life of a
Page object.
These combine existing server and HTML controls by using the Visual Studio .NET Designer to
create functional units that encapsulate some aspect of the user interface. User controls reside
in content files, which must be included in the project in which the controls are used.
These create entirely new controls by rendering HTML directly rather than using composition.
These controls are compiled and can be used from the Toolbox, just like composite controls, but
you must write extra code to handle tasks that are performed automatically in composite
controls.
5. If we have a web service how does the client know if the location of the web
service is changed?? Ans: Using the URL property.
6. What is a DataProvider?
A data provider is a set of classes that provide access to databases. The main components of
data providers are:
d. DataAdapter
7. What is DataSet?
The DataSet is a disconnected, in-memory representation of data. The DataSet
persists in memory, and the data therein can be manipulated and updated independent of
the database. A DataSet object contains DataTables,
A DataSet contain
• ExecuteNonQuery:
• ExecuteScalar:
• ExecuteReader:
System.Data Classes, types, and services for creating and accessing data sets
and their subordinate objects
System.Data.SqlClient Classes and types for accessing Microsoft SQL Server databases
System.Data.OracleClient Classes and types for accessing Oracle databases (Microsoft
.NET Framework version 1.1 and later)
System.Data.OleDb Classes and types for accessing other databases
10. Differenece between DataSet and DataReader and which is faster?
??????????????
IsPostBack gets a value indicating whether the page is being loaded in response to a client
postback, or if it is being loaded and accessed for the first time. true if the page is being loaded in
response to a client postback; otherwise, false.
View State is the mechanism ASP.NET uses to keep track of server control state values that
don't otherwise post back as part of the HTTP form. It's a hidden form field managed by the
ASP.NET page framework.
13. A Windows application, say myapp.exe when complied what files are generated?
14. what is a typed dataset?
The 3 objects of ADO are Command object, Connection object and Recordset object.
Open Question
17. Server Side Controls and what is the diff between Server controls and HTML
controls?
Server events Trigger control-specific events on the server. Can trigger only page- level
events on server (postback).
State Data entered in a control is maintained Data is not maintained; must
management across requests. be saved and restored using
page-level scripts.
Adaptation Automatically detect browser and adapt No automatic adaptation;
display as appropriate. must detect browser in code
or write for least common
denominator.
Properties The Microsoft .NET Framework provides a HTML attributes
set of properties for each control. Properties
allow you to change the control's
appearance and behavior within server-side
code.
Its used for separating the code and the html. You specify in @page directive. The syntax
goes like this. <% @page language=C# codebehind=”somewebform.aspx.cs” ..%> Code-
behind files are pre-compiled modules written in any of the Microsoft .NET runtime compliant
languages
19. What are Configuration files and how many are there? Which config file replaces
web.config file?
This file is located in the %runtime installation path%\Config directory and contains settings that
affect all the applications that run on the machine. This file contains an element called
<appSettings>. This element contains application-specific settings, which you can modify to
define the settings required by your application. When you run an application, the runtime checks
for any additions made to the system configuration file and then checks the settings in the
application configuration file.
This file contains the settings required to configure an individual application. For ASP.NET-
hosted applications, the configuration file is named Web.config and is located in the Web
application folder. It contains fields like authuentication, authorization, custom errors, tracing etc.
The security configuration files contain security permissions for a hierarchy of code groups.
Code groups are logical groups of code that are related to each other through common
characteristics such as application directory, strong name, URL, site, and zone.
OleDb is used for databases other databases like Oracle etc and also for Sql Server 6.0 or lower.
SQL client is used to access Sql Server 7.0 and above.
The data that ASP.NET preserves between requests is called the Web form's View state. By
default, a Web form's view state is available only within that Web form. To make data entered on
a Web form available to other Web forms in an application, you need to save the data in a state
variable in the Application or Session objects. These objects provide two levels of scope:
These are available only to a single session (user). Session state is like global data in a standard
Windows application. Only the current session has access to its Session state.
Cookies are used to store small amounts of information on a client. A small file that a Web
application can write to the client's computer. Cookies are used to identify a user in a future
session or to store and retrieve information about the user's current session. Clients might refuse
cookies, so the code has to anticipate that possibility.
ASP.NET stores items added to a page's ViewState property as hidden fields on the page.
???
It represents information about a specific culture including the names of the culture, the writing
system, and the calendar used, as well as access to culture-specific objects that provide
information for common operations, such as formatting dates and sorting strings.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/converttoaspnet.asp
????
adLockReadOnly (1) - Indicates read-only records. You cannot alter the data.
adLockPessimistic (2) - Indicates pessimistic locking, record by record. The provider does what is
necessary to ensure successful editing of the records, usually by locking records at the data
source immediately after editing.
adLockOptimistic (3) - Indicates optimistic locking, record by record. The provider uses optimistic
locking, locking records only when you call the Update method.
adLockBatchOptimistic (4) - Indicates optimistic batch updates. Required for batch update mode.
adLockUnspecified (-1) - Does not specify a type of lock. For clones, the clone is created with the
same lock type as the original.
adOpenForwardOnly (0) - Default. Uses a forward-only cursor. Identical to a static cursor, except
that you can only scroll forward through records. This improves performance when you need to
make only one pass through a Recordset.
adOpenKeyset (1) - Uses a keyset cursor. Like a dynamic cursor, except that you can't see
records that other users add, although records that other users delete are inaccessible from your
Recordset. Data changes by other users are still visible.
adOpenDynamic (2) - Uses a dynamic cursor. Additions, changes, and deletions by other users
are visible, and all types of movement through the Recordset are allowed, except for bookmarks,
if the provider doesn't support them.
adOpenStatic (3) - Uses a static cursor. A static copy of a set of records that you can use to find
data or generate reports. Additions, changes, or deletions by other users are not visible.
adOpenUnspecified (-1) - Does not specify the type of cursor.
Rs.CursorType = adOpenDynamic
VbScript.
it's aspnet_wp.
Server side code executes on the server and client side code runs on the client machine. Scripts
run on Client side. Client side code is written in like VBScript or JavaScript.
The validation controls check the validity of data entered in associated server controls on the
client before the page is posted back to the server. This is an important improvement to previous
validation schemes--most validity problems can be caught and corrected by the user without a
round-trip to the server.
38. What does the "EnableViewState" property do? Why would I want it on or off?
EnableViewState enables the Page's ViewState to be saved between the page reuests. To turn
off state management for a server control, set the control's EnableViewState property to False.
DataSet is a collection of Data Tables and its disconnected. A recordset looks like a single
table. If a recordset is to contain data from multiple database tables, it must use a JOIN query,
which assembles the data from the various database tables into a single result table. ADO is used
for Connected access.
42. Can you give an example of what might be best suited to place in
the Application_Start and Session_Start subroutines?
46. Can you explain what inheritance is and an example of when you
might use it?
47. How would you implement inheritance using VBNET/C#?
48. Whats an assembly?
An assembly is a self-describing collection of code, resources, and metadata. The
assembly manifest contains information about what is contained within the assembly.
49. Describe the difference between inline and code behind - which is
best in a loosely coupled solution?
Code behind is loosely coupled.
An XML format. Can be used by other platforms so send and receive data to a .NET application
51. Where would you use an iHTTPModule, and what are the limitations
of any approach you might take in implementing one
????????
52. What the disadvantages are of viewstate/what are the benefits?
Because ViewState stores data on the page, it is limited to items that can be serialized. If you
want to store more complex items in ViewState, you must convert the items to and from a string.
53. Describe session handling in a webform, how does it work and what
are the limits?
54. How would you get ASPNET running in Apache web servers - why
would you even do this?
55. Whats MSIL, and why should my developers need an appreciation of
it if at all?
56. In what order do the events of an ASPX page execute As a
developer is it important to undertsand these events?
57. Which method do you invoke on the DataAdapter control to load your
generated dataset with data?
Fill Method
58. Can you edit data in the Repeater control?
Yes
59. Which template must you provide, in order to display data in a
Repeater control?
ItemTemplate
60. How can you provide an alternating color scheme in a Repeater
control?
AlternatingItemTemplate
61. 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?
Set the datasource property and call the DataBind method
62. What base class do all Web Forms inherit from?
Page...but all .NET objects inherit form the Object Base Class.
63. What method do you use to explicitly kill a user s session?
Session.Contents.Remove
64. How do you turn off cookies for one page in your site?
You can't (not that I am aware of...since there is no Page level directive to do this)
65. Which two properties are on every validation control?
66. 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
67. How do you create a permanent cookie?
68. What tag do you use to add a hyperlink column to the DataGrid?
69. What is the standard you use to wrap up a call to a Web service
70. Which method do you use to redirect the user to another page
without performing a round trip to the client?
71. What is the transport protocol you use to call a Web service SOAP
72. True or False: A Web service can only be written in NET
73. What does WSDL stand for?
74. What property do you have to set to tell the grid which page to go
to when using the Pager object?
75. Where on the Internet would you look for Web services?
76. What tags do you need to add within the asp:datagrid tags to bind
columns manually
77. 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?
78. How is a property designated as read-only?
79. Which control would you use if you needed to make sure the values
in two different controls matched?
80. True or False: To test a Web service you must create a windows
application or Web application to consume this service?
81. How many classes can a single NET DLL contain?
82. What is the role of global.asax?
C# Top
1. Abstract class/interface
An Abstract class is that cannot be instantiated. An abstract class is a class that must be inherited
and have the methods overridden. An abstract class is essentially a blueprint for a class without
any implementation.
An Interface is an abstract class with public abstract methods all of which must be implemented in
the inherited classes. It's a
2. Constructors/destructors
Constructors allow initialization code to perform for a class. A class constructor first creates a new
instance of that class on the heap and then performs initialization.
A String is called immutable because its value cannot be modified once it has been created.
Methods that appear to modify a String actually return a new String containing the modification.
Most of the methods that modify an instance of this class return a reference to that same
instance. Since a reference to the instance is returned, you can call a method or property on the
reference. This can be convenient if you want to write a single statement that chains successive
operations one after another.
A StringBuilder can allocate more memory as needed to store characters when the value
of an instance is enlarged, and the capacity is adjusted accordingly. The amount of memory
allocated is implementation-specific, and ArgumentOutOfRangeException is thrown if the amount
of memory required is greater than the maximum capacity.
The capacity of a StringBuilder is the maximum number of characters the instance can store at
any given time, and is greater than or equal to the length of the string representation of the value
of the instance. The capacity can be increased or decreased with the Capacity property or
EnsureCapacity method, but it cannot be less than the value of the Length property.
New keyword in C# is used to hide the implementation of the Base class and to provide a
new implementation. The access modifier of the new class can be different.
We can create new classes by inheriting the features (i.e. methods and properties) of a base
class along with adding our own features to represent that class as a more realistic entity. For
example If class B inherits from class A, then B is said to be derived from A then the class B has
all the features present in class A.
The languages C#, C++, VB, J# are the most popular ones supported by .NET. There are around
2 dozens of languages supported by .NET to-date.
(Interviewer said No, but in the book its said Yes) ProtectedInternal takes the intersection (He
said so, but book says Union) properties of Protected and Internal. An Internal function can be
accessed only from the assembly and Protected can be accessed by the types that inherit it.
These files enable you to manage application-level and session-level events. These files reside in
the root directory of an ASP.NET Web application or ASP.NET Web service. The Global.asax.cs
or Global.asax.vb class file is a hidden, dependent file of Global.asax, which contains the code for
handling application events such as the Application_OnError event.
Cookies are small files which can be written to the client machine to store user preferences, login
information etc. But a user might reject cookies. So there should be an alternate method if a user
rejects them.
But View State is a hidden value which stores the state information. I think View state is better,
since a user doesn't know abt it.
20. what is caching and how many types of caching are there?
Caching is the technique of storing frequently used items in memory so that they can be
accessed more quickly. Caching is important to Web applications because each time a Web
form is requested, the host server must process the Web form's HTML and run Web form code to
create a response. By caching the response, all that work is bypassed. Instead, the request is
served from the reponse already stored in memory.
Use the @OutputCache page directive to cache a Web form in the server's memory. The
@OutputCache directive's Duration attribute controls how long the page is cached.
When used on a Web form, the OutputCache directive has two required attributes: Duration and
VaryByParam. The VaryByParam attribute lets you cache multiple responses from a single Web
form based on varying HTTP POST or query string parameters.
VaryByParam Cache multiple responses for a single Web form based on an HTTP
POST parameter or query string.
VaryByHeader Cache multiple responses for a single Web form based on the HTTP
request header sent from the client.
VaryByCustom Cache multiple responses for a single Web form based on a custom
string.
Duration Set the amount of time a response is cached.
VaryByControl Cache multiple responses for a single user control based on the value
of one or more controls contained in the user control.
Fragment caching is caching only parts of web form which don't change between the requests.
Applicaton Data can also be cached using Cache object.
The common language runtime can be thought of as the environment that manages code
execution. It provides core services, such as code compilation, memory allocation, thread
management, and garbage collection. Through the common type system (CTS), it enforces
strict type-safety and ensures that code is executed in a safe environment by also enforcing
code access security.
The Common Language Specification (CLS) defines the minimum standards to which .NET
language compilers must conform. Thus, the CLS ensures that any source code successfully
compiled by a .NET compiler can interoperate with the .NET Framework.
A Web application lives as long as it has active sessions, whereas Web forms live for barely a
moment. The life of a Web application begins when a browser requests the start page of the
application. At that point, the Web server swings into action, starting the assembly (DLL) that
responds to that request. The executable creates an instance of the requested Web form,
generates the HTML to respond to the request, and posts that response to the browser. It then
destroys the instance of the Web form.
When the browser has the generated HTML, the user can type text in boxes, select options, and
perform other tasks until triggering a postback event, such as a button click. Postback events
cause the browser to send the page's data (view state) back to the server for event processing.
When the server receives the view state, it creates a new instance of the Web form, fills in the
data from the view state, and processes any events that occurred. (See Figure 2-13.) As soon as
the server has finished, it posts the resulting HTML back to the browser and destroys the instance
of the Web form.
When the user stops using the Web application for a period of time (the default is 20 minutes),
the user's session times out and ends. (See Figure 2-14.) If there are no other sessions from
other users, the application ends. This doesn't always happen right away. The common language
runtime (CLR) manages memory using garbage collection rather than reference counting, as OLE
did. Garbage collection means that the server periodically traces through the references between
objects. When the runtime finds an object that is no longer used, it throws the object away and
recovers the memory. This means that you don't know exactly when an Application_End event will
occur.
It is supported thru Interfaces. I don't why the feature is not there in .Net
30. what is the difference between declaring a variable as constant, static and read
only?
The first creates a compile-time constant, the second creates a run-time class constant, and the
third creates a run-time object constant.
The symbols you define for compile-time constants are replaced with the value of the constant at
compile time.
readonly values are also constants, in that they cannot be modified after the constructor has
executed. readonly values are different, however, in that they're set at run time. Secondaly, you
can use readonly values for instance constants, storing different values for each instance of a
class type. Updating the value of a public constant is really an interface change. Updating the
value of a readonly constant is easily upgradeable. Constants can be used in places where
readonly values cannot, namely attributes.
Because the value cannot be changed once its initialized. The methods that look like changing
the string value actually creates a new instance and stores the new value.
Using Gacutil /I. But first the Assembly should have a Strong Name to uniquely identify the
Assembly. Strong name can be created using SN.exe
Its Global Assembly cache where you u want to register your assemblies to share them across
applications.
Role-based authorization lets you identify groups of users to allow or deny based on their role in
your organization.
36. what is a Web Garden and Web Farm?
A Web application running on a single server that has multiple CPUs is called a Web garden in
the ASP.NET documentation. A Web application running on multiple servers is called a Web farm.
37. what is the difference between unmanaged coponenet being registered into the
registry and registring managed componenet into GAC?
38. How do u maintain Session variable in WebFarm?
Session data persists as the user browses through multiple pages. Session in ASP.NET is
configured by the <sessionState> element, which you'll find in the web.config file in any ASP.NET
project.
<sessionState mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=localhost;
user id=sa;password="
cookieless="false" timeout="20"/>
The most important attribute in Listing 12 is mode, which can be set to InProc, StateServer, or
SQLServer. This attribute determines exactly where session data is stored.
Forms authentication automatically displays a designated Web form to collect user name and
password information. Code associated with that Web form authenticates and authorizes users
based on a user list stored in the application's Web.config file or in a separate user database.
Passport authentication identifies users via Microsoft Passport's single sign-on service.
Microsoft Passport is meant to provide Internet users with a single identity that they can use to
visit a wide variety of Web sites that require authentication.
The process of executing native code from within a .NET assembly is called platform invoke, or
pinvoke for short.
2. Declare the unmanaged procedure using the DllImport attribute or the Declare statement.
3. Map the data types of the procedures parameters to the equivalent .NET types.
4. Call the unmanaged procedure and test its return value for success.
5. If the procedure did not succeed, retrieve and handle the exception code using the Marshal
object's GetLastWin32Error method.
When you call an unmanaged procedure from a .NET assembly, the CLR collects the parameters
and converts their types in a process called Marshaling.
o .Net uses Runtime Callable Wrapper (RCW) to communicate with COM components
o .Net client can use COM components using the following methods
▪ Using TlbImp.exe to import the type libraries
• Eg. TlbImp Mylib.tlb /out:Mylib.dll
.Net uses COM Callable Wrapper (CCW) for .Net components to be made available for COM
clients. COM Server used Service Control Manager (SCM) to identify the COM components. In
order for the SCM to locate our .Net component, it should be converted into a type library (.tlb
extension).
o Steps involved in making .Net components available for COM clients
▪ There is no special task needed at the time of creating .Net component
▪ Use TlbExp.exe to export .Net component to create type library
• Eg. TlbExp MyLib.dll /out:Mylib.tlb
▪ Use RegAsm.exe to create type library and register it in the registry
• Eg. RegAsm MyLib.dll /tlb:Mylib.tlb
With runtime polymorphism based on method overriding, the decision as to which version of a
method will be executed is based on the actual type of object whose reference is stored in the
reference variable, and not on the type of the reference variable on which the method is invoked.
51. how do u make an WIN 32 API function call from managed code ?
P Invoke.
56. What's the implicit name of the parameter that gets passed into the class set
method? Value, and its datatype depends on whatever variable we're changing.
57. How do you inherit from a class in C#? Place a colon and then the name of the base
class. Notice that it's double colon in C++.
58. Does C# support multiple inheritance? No, use interfaces instead.
59. When you inherit a protected class-level variable, who is it available to? Classes in
the same namespace.
60. Are private class-level variables inherited? Yes, but they are not accessible, so
looking at it you can honestly say that they are not inherited. But they are.
61. Describe the accessibility modifier protected internal. It's available to derived classes
and classes within the same Assembly (and naturally from the base class it's declared
in).
62. C# provides a default constructor for me. I write a constructor that takes a string
as a parameter, but want to keep the no parameter one. How many constructors
should I write? Two. Once you write at least one constructor, C# cancels the freebie
constructor, and now you have to write one yourself, even if there's no implementation in
it.
63. What's the top .NET class that everything is derived from? System.Object.
64. How's method overriding different from overloading? When overriding, you change
the method behavior for a derived class. Overloading simply involves having a method
with the same name within the class.
65. What does the keyword virtual mean in the method definition? The method can be
over-ridden.
66. Can you declare the override method static while the original method is non-
static? No, you can't, the signature of the virtual method must remain the same, only the
keyword virtual is changed to keyword override. But you can do that if u do Shadowing
(VB.Net) or Hiding(C#).
67. Can you override private virtual methods? No, moreover, you cannot access private
methods in inherited classes, have to be protected in the base class to allow any sort of
access.
68. Can you prevent your class from being inherited and becoming a base class for
some other classes? Yes, that's what keyword sealed in the class definition is for. The
developer trying to derive from your class will get a message: cannot inherit from Sealed
class WhateverBaseClassName. It's the same concept as final class in Java.
69. Can you allow class to be inherited, but prevent the method from being over-
ridden? Yes, just leave the class public and make the method sealed.
70. What's an abstract class? A class that cannot be instantiated. A concept in C++ known
as pure virtual method. A class that must be inherited and have the methods over-ridden.
Essentially, it's a blueprint for a class without any implementation.
71. When do you absolutely have to declare a class as abstract (as opposed to free-
willed educated choice or decision based on UML diagram)? When at least one of
the methods in the class is abstract. When the class itself is inherited from an abstract
class, but not all base abstract methods have been over-ridden.
72. What's an interface class? It's an abstract class with public abstract methods all of
which must be implemented in the inherited classes.
73. Why can't you specify the accessibility modifier for methods inside the interface?
They all must be public. Therefore, to prevent you from getting the false impression that
you have any freedom of choice, you are not allowed to specify any accessibility, it's
public by default.
74. Can you inherit multiple interfaces? Yes, why not.
75. And if they have conflicting method names? It's up to you to implement the method
inside your own class, so implementation is left entirely up to you. This might cause a
problem on a higher-level scale if similarly named methods from different interfaces
expect different data, but as far as compiler cares you're okay.
76. What's the difference between an interface and abstract class? In the interface all
methods must be abstract; in the abstract class some methods can be concrete. In the
interface no accessibility modifiers are allowed, which is ok in abstract classes.
77. How can you overload a method? Different parameter data types, different number of
parameters, different order of parameters.
78. If a base class has a bunch of overloaded constructors, and an inherited class has
another bunch of overloaded constructors, can you enforce a call from an
inherited constructor to an arbitrary base constructor? Yes, just place a colon, and
then keyword base (parameter list to invoke the appropriate constructor) in the
overloaded constructor definition inside the inherited class.
79. What's the difference between System.String and System.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.
80. What's the advantage of using System.Text.StringBuilder over System.String?
StringBuilder is more efficient in the cases, where a lot of manipulation is done to the text.
Strings are immutable, so each time it's being operated on, a new instance is created.
81. Can you store multiple data types in System.Array? No.
82. What's the difference between the System.Array.CopyTo() and
System.Array.Clone()? The first one performs a deep copy of the array, the second one
is shallow.
83. How can you sort the elements of the array in descending order? By calling Sort()
and then Reverse() methods.
84. What's the .NET datatype that allows the retrieval of data by a unique key?
HashTable.
85. What's class SortedList underneath? A sorted HashTable.
86. Will finally block get executed if the exception had not occurred? Yes.
87. What's the C# equivalent of C++ catch (…), which was a catch-all statement for 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 {}.
88. Can multiple catch blocks be executed? No, once the proper catch code fires off, the
control is transferred to the finally block (if there are any), and then whatever follows the
finally block.
89. Why is it a bad idea to throw your own exceptions? 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.
90. What's a delegate? A delegate object encapsulates a reference to a method. In C++
they were referred to as function pointers.
91. What's a multicast delegate? It's a delegate that points to and eventually fires off
several methods.
92. How's the DLL Hell problem solved in .NET? Assembly versioning allows the
application to specify not only the library it needs to run (which was available under
Win32), but also the version of the assembly.
93. What are the ways to deploy an assembly? An MSI installer, a CAB archive, and
XCOPY command.
94. What's a satellite assembly? When you write a multilingual or multi-cultural application
in .NET, and want to distribute the core application separately from the localized modules,
the localized assemblies that modify the core application are called satellite assemblies.
95. What namespaces are necessary to create a localized application?
System.Globalization, System.Resources.
96. What's the difference between // comments, /* */ comments and /// comments?
Single-line, multi-line and XML documentation comments.
97. How do you generate documentation from the C# file commented properly with a
command-line compiler? Compile it with a /doc switch.
98. What's the difference between <c> and <code> XML documentation tag? Single line
code example and multiple-line code example.
99. Is XML case-sensitive? Yes, so <Student> and <student> are different elements.
100.What debugging tools come with the .NET SDK? CorDBG - command-line debugger,
and DbgCLR - graphic debugger. Visual Studio .NET uses the DbgCLR. To use CorDbg,
you must compile the original C# file using the /debug switch.
101.What does the This window show in the debugger? It points to the object that's
pointed to by this reference. Object's instance data is shown.
102.What does assert() do? In debug compilation, assert takes in a Boolean condition as a
parameter, and shows the error dialog if the condition is false. The program proceeds
without any interruption if the condition is true.
103.What's the difference between the Debug class and Trace class? Documentation
looks the same. Use Debug class for debug builds, use Trace class for both debug and
release builds.
104.Why are there five tracing levels in System.Diagnostics.TraceSwitcher? The tracing
dumps can be quite verbose and for some applications that are constantly running you
run the risk of overloading the machine and the hard drive there. Five levels range from
None to Verbose, allowing to fine-tune the tracing activities.
105.Where is the output of TextWriterTraceListener redirected? To the Console or a text
file depending on the parameter passed to the constructor.
106.How do you debug an ASP.NET Web application? Attach the aspnet_wp.exe process
to the DbgClr debugger.
107.What are three test cases you should go through in unit testing? Positive test cases
(correct data, correct output), negative test cases (broken or missing data, proper
handling), exception test cases (exceptions are thrown and caught properly).
108.Can you change the value of a variable while debugging a C# application? Yes, if
you are debugging via Visual Studio.NET, just go to Immediate window.
109.Explain the three services model (three-tier application). Presentation (UI), business
(logic and underlying code) and data (from storage or other sources).
110.What are advantages and disadvantages of Microsoft-provided data provider
classes in ADO.NET? SQLServer.NET data provider is high-speed and robust, but
requires SQL Server license purchased from Microsoft. OLE-DB.NET is universal for
accessing other sources, like Oracle, DB2, Microsoft Access and Informix, but it's a .NET
layer on top of OLE layer, so not the fastest thing in the world. ODBC.NET is a
deprecated layer provided for backward compatibility to ODBC engines.
111.What's the role of the DataReader class in ADO.NET connections? It returns a read-
only dataset from the data source when the command is executed.
112.What does the parameter Initial Catalog define inside Connection String? The
database name to connect to.
113.What's the data provider name to connect to Access database? Microsoft.Access.
114.What does Dispose method do with the connection object? Deletes it from the
memory.
115.What is a pre-requisite for connection pooling? Multiple processes must agree that
they will share the same connection, where every parameter is the same, including the
security settings.
116.what are Virtual functions?
The virtual keyword is used to modify a method or property declaration, in which case
the method or the property is called a virtual member. When a virtual method is invoked,
the run-time type of the object is checked for an overriding member. The overriding
member in the most derived class is called, which might be the original member, if no
derived class has overridden the member. By default, methods are non-virtual. You
cannot override a non-virtual method. You cannot use the virtual modifier with the
following modifiers: static abstract override
117.what is an abstract ?
Use the abstract modifier in a class declaration to indicate that a class is intended only to be a
base class of other classes.
• It is not possible to modify an abstract class with the sealed modifier, which means that the class
cannot be inherited.
• A non-abstract class derived from an abstract class must include actual implementations of all
inherited abstract methods and accessors.
Application_Start The first user visits a page within your Web application.
Application_End There are no more users of the application.
Application_BeginRequest At the beginning of each request to the server. A request happens
every time a browser navigates to any of the pages in the
application.
Application_EndRequest At the end of each request to the server.
Session_Start A new user visits a page within your application.
Session_End A user stops requesting pages from the Web application and their
session times out. Sessions time out after a period specified in the
Web.config file.
119.what are namespaces and what is namespace collision?
Namespaces are a way of organizing code. They provide protection from conflicting
names, sometimes called namespace collisions. This protection is especially necessary
in large projects in which it is very easy for two items to accidentally have the same
name.
120.what is the difference between Using and Reference?
You add project references to use namespaces outside of the current project. Use the
Imports statement to provide a shortcut to that namespace. The Imports statement simply
provides an abbreviated way to refer to a namespace in code
121.what are delegates and why are they used?
A delegate is a class that holds a reference to the method that is called when an event is
fired. Delegates are types used to invoke one or more methods where the actual method invoked
is determined at run time. This provides a safe way for derived objects to subscribe to events
provided by their base class. Delegates also provide a way for programs to respond to
asynchronous procedures.
Simply put, delegates provide a way to invoke methods by their address rather than by their
name. The delegate's declaration must match the signature of the methods invoked. This rule
ensures that delegation is type-safe. the most important reason is that delegates provide the
flexibility required for responding to events and asynchronous tasks running in separate threads.
1. Context.Handler object
Use this object to retrieve public members of one Web form's class from a subsequently
displayed Web form.
1. Query strings
Use these strings to pass information between requests and responses as part of the Web
address. Query strings are visible to the user, so they should not contain secure information such
as passwords.
2. Cookies
Use cookies to store small amounts of information on a client. Clients might refuse cookies, so
your code has to anticipate that possibility.
3. View state
ASP.NET stores items added to a page's ViewState property as hidden fields on the page.
4. Session state
Use Session state variables to store items that you want keep local to the current session
(single user).
5. Application state
Use Application state variables to store items that you want be available to all users of the
application.
ReadUncommitted Does not lock the records being read. This means that an uncommitted change
can be read and then rolled back by another client, resulting in a local copy of a
record that is not consistent with what is stored in the database. This is called a
dirty read because the data is inconsistent.
Chaos Behaves the same way as ReadUncommitted, but checks the isolation level of
other pending transactions during a write operation so that transactions with
more restrictive isolation levels are not overwritten.
ReadCommitted Locks the records being read and immediately frees the lock as soon as the
records have been read. This prevents any changes from being read before they
are committed, but it does not prevent records from being added, deleted, or
changed by other clients during the transaction. This is the default isolation level.
RepeatableRead Locks the records being read and keeps the lock until the transaction completes.
This ensures that the data being read does not change during the transaction.
Serializable Locks the entire data set being read and keeps the lock until the transaction
completes. This ensures that the data and its order within the database do not
change during the transaction.
125.
.NET Top
All the data associated with a value type is allocated on the stack. When a variable of a Value
Type goes out of scope, it is destroyed and its memory is reclaimed. A variable of a reference
type, on the other hand, exists in two memory locations. The actual object data is allocated on the
heap. A variable containing a pointer to that object is allocated on the stack. When that variable is
called by a function, it returns the memory address for the object to which it refers. When that
variable goes out of scope, the object reference is destroyed but the object itself is not. If any
other references to that object exist, the object remains intact. If the object is left without any
references, it is subject to garbage collection.
1. What Is NUnit?
NUnit is a unit-testing framework for all .Net languages. Initially ported from JUnit, the
current version, 2.1 is the third major release of this xUnit based unit testing tool for
Microsoft .NET. It is written entirely in C# and has been completely redesigned to take
advantage of many .NET language features, for example custom attributes and other
reflection related capabilities. NUnit brings xUnit to all .NET languages.
instead of
before aa
SQL: Top
Using Constraints.
2. what are differenet constraints? NOT NULL, CHECK, UNIQUE, PRIMARY KEY,
FOREIGN KEY
3. What is Save Point and Rollback action?
Save point is a point within a database transaction from which you can restore the database
state.
Indexes are database objects designed to improve query performance. Indexes are
structured to facilitate the rapid return of result sets. The two types of indexes that SQL Server
supports are clustered and nonclustered indexes.
A clustered index contains table records in the leaf level of the B-tree. A nonclustered index
contains a bookmark to the table records in the leaf level. If a clustered index exists on a table, a
nonclustered index uses it to facilitate data lookup. In most cases, you will create a clustered
index on a table before you create nonclustered indexes.
SQL Server has an algorithm to detect deadlocks, a condition in which two connections have
blocked each other. If an instance of SQL Server detects a deadlock, it will terminate one
transaction, allowing the other to continue.
Every SQL Server database has a transaction log that records all transactions and the database
modifications made by each transaction.
The two primary categories of errors are computer errors, such as an unavailable database
server, and user errors. Return codes and the @@ERROR function are used to handle errors
that occur when a procedure is executed.
There are five classes of stored procedures: system stored procedures, local stored procedures,
temporary stored procedures, extended stored procedures, and remote stored procedures.
13. what are triggers? and how many are there?what does each one do?
Triggers are a special class of stored procedure defined to execute automatically in place of or
after data modification. The three commands that fire a trigger are UPDATE, INSERT, and
DELETE. Use triggers to extend data integrity and to implement complex business logic.
A lock is an object that software uses to indicate that a user has some dependency on a
resource. The software does not allow other users to perform operations on the resource that
would adversely affect the dependencies of the user who owns the lock. Locks are managed
internally by system software and are acquired and released based on actions that the user
takes.
SQL Server supports four types of data integrity: entity integrity, domain integrity, referential
integrity, and user-defined integrity.
17. what is a foreign key,primary key and unique key and their differences?
18. what are Hash Tables?
19. what does delete table and trunctate table do?
The TRUNCATE TABLE statement is a fast, non-logged method of deleting all rows in a
table. This method is almost always faster than a DELETE statement with no conditions, because
DELETE logs each row deletion and TRUNCATE TABLE logs only the deallocation of whole
data pages. The TRUNCATE TABLE statement immediately frees all of the space occupied by
that table's data and indexes. The distribution pages for all indexes are also freed.
Like authentication, system stored procedures are used to manage SQL Server authorization.
Use sp_grantdbaccess and sp_revokedbaccess to grant or revoke database access to a security
account. These system stored procedures work with all valid security accounts, Windows
accounts, and SQL Server login IDs. Granting access is also called mapping an account to a
database.
You use system stored procedures to manage SQL Server authentication. Use the sp_grantlogin,
sp_denylogin, and sp_revokelogin system stored procedures to manage Windows account
authentication. Use the sp_addlogin and sp_droplogin system stored procedures to manage SQL
Server login ID authentication.
Do not create indexes for every column in a table, because too many indexes will negatively
impact performance. The majority of databases are dynamic; that is, records are added, deleted,
and changed regularly. When a table containing an index is modified, the index must be updated
to reflect the modification. If index updates do not occur, the index will quickly become ineffective.
Therefore, INSERT, UPDATE, and DELETE events trigger the Index Manager to update the table
indexes. Like tables, indexes are data structures that occupy space in the database. The larger
the table, the larger the index that is created to contain the table. Before creating an index, you
must be sure that the increased query performance afforded by the index outweighs the
additional computer resources necessary to maintain the index.
Administer through the web browser or through the IIS Snap-in (Microsoft Suggestions)
RAID (Redundant Array of Inexpensive Disks) is used to provide fault tolerance to database
servers. (Basically for data protection just in case a hard drive or system fails)
38. What is the disadvantage of creating an index in every column of a database table?
Disadvantage is it slows down the modification of data into those columns because every time
data changes in the table, all the indexes need to be updated.
39. You have a query that runs slowly, how would you make it better.
But some general issues that you could talk about would be: No indexes, table scans, missing or
out of date statistics, blocking, excess recompilations of stored procedures, procedures and
triggers without SET NOCOUNT ON, poorly written query with unnecessarily complicated joins,
too much normalization, excess usage of cursors and temporary tables. Some of the tools/ways
that help you troubleshooting performance problems are: SET SHOWPLAN_ALL ON, SET
SHOWPLAN_TEXT ON, SET STATISTICS IO ON, SQL Server Profiler, Windows NT /2000
Performance monitor, Graphical execution plan in Query Analyzer. Download the white paper on
performance tuning SQL Server from Microsoft web site. Don't forget to check out SQL Server
2hPerformance
Bit data type consists of either 1 or 0 (on or off) is generally used as a boolean type where the
answer is either true/false, on/off, yes/no, etc...
Connection, Command, Recordset (There are actually more than 3 (Primary objects are
(Connection, Command, Field and Recordset) Secondary objects are (Parameters, Properties
and Errors)))
42. What is the wildcard character in SQL? Let's say you want to query database with
LIKE for all employees whose name starts with La. The wildcard character is %, the
proper query with LIKE would involve 'La%'.
43. Explain ACID rule of thumb for transactions. Transaction must be Atomic (it is one unit
of work and does not dependent on previous and following transactions), Consistent
(data is either committed or roll back, no “in-between” case where something has been
updated and something hasn't), Isolated (no transaction sees the intermediate results of
the current transaction), Durable (the values persist if the data had been committed even
if the system crashes right after).
44. What connections does Microsoft SQL Server support? Windows Authentication (via
Active Directory) and SQL Server authentication (via Microsoft SQL Server username and
passwords).
45. Which one is trusted and which one is untrusted? Windows Authentication is trusted
because the username and password are checked with the Active Directory, the SQL
Server authentication is untrusted, since SQL Server is the only verifier participating in
the transaction.
46. Why would you use untrusted verificaion? Web Services might use it, as well as non-
Windows applications.
47. where are the three places you can store Session variables?
6. Inside the ASP.NET runtime process (aspnet_wp.exe). This is the default option and is
the best choice from a performance perspective but suffers from the same problem as
ASP session storage: if the Web server crashes you will lose all information.
7. Inside a dedicated Windows Service. A Windows Service is a durable process that
usually starts when the computer boots and can survive logins and logouts (in fact, IIS
itself runs as a Windows Service). This technique is slower than the first option, because
the ASP.NET runtime must retrieve session information from the external Service, rather
than from its own process. However, this option is more durable, as session information
persists even if the Web server crashes or is restarted.
8. Inside a Microsoft® SQL Server™ database. This option is the most durable of the
three. Although the second option protects against Web server crashes, session
information is still lost if the entire machine crashes. Because this third option logs
Session to a database (as opposed to the computer's memory), it will survive even a
machine reboot. From a performance perspective, this option is by far the slowest.
Functions MUST return value whereas stored procedure need not. Functions have the
advantage of being able to be imbedded in a larger statement.
The .NET Remoting system provides a number of services to activate objects, control the lifetime
of each object, and transport messages to and from remote objects using communication
channels. Communication channels are the objects that transport messages between the remote
objects.
Serialization formatters are the objects that help you to encode and decode messages that
are sent to or received from a remote object. Two kinds of encoding are possible for all
messages:
• binary and
• XML encoding.
XML Web services are program components that allow you to build scalable, loosely
coupled, platform-independent applications. XML Web services enable disparate applications
to exchange messages using standard protocols such as HTTP, XML, XSD, SOAP, and Web
Services Description Language (WSDL).
1. Marshal-by-value objects.
These objects are copied and passed by value out of the application domain.
2. Marshal-by-reference objects.
The clients that use these objects need a proxy to access the object remotely.
To communicate between server objects and clients in .NET Remoting, you need to use object
references of the server object in the client application. When you create an instance of the
remote object using the new keyword, your client receives a reference to the server object. After
obtaining the object reference, the client can call methods on the server object as if the object
resides in the client's process and does not run on a separate computer.
.NET Remoting uses proxy objects to allow the use of the server object in the client process.
When you create an instance of the remote object type in the client application, .NET Remoting
creates a proxy object and sends it to the client application. This proxy object contains references
to all the methods and properties of the server object. When you call a method that is on that
proxy object, the remoting system receives the call, routes it to the server process, invokes the
server object, and returns the return value to the client proxy, which returns the result to the client
application.
7. what are the 2 ways of activation modes in .Net remoting system and Explain?
They are Server activation and client activation. In server activation, objects are created on
the server when you call a method in the server class. However, objects are not created when
you use the new keyword to create an instance of the server class
Client-activated objects are created on the server when you create an instance using the new
keyword.
Static members You cannot export static members, such as fields and methods, remotely.
.NET Remoting needs instance members to enable communication between
the client and server objects.
Instance fields The .NET Remoting system checks whether the object that you use is
and accessors exported as a proxy object. If it is a proxy object, the client can directly access
instance fields through the proxy. If the exported object is not a proxy, the
proxy object provides instance accessors to the client.
Private members You cannot export private members of a remote object.
1. A server object that exposes the functionality to callers outside its boundary
Singleton objects can have only one instance regardless of the number of clients they
have. These objects also have a default lifetime. Therefore, if you create a server object as a
Singleton object, a single instance of the server object manages all the clients. When you declare
an object as a SingleCall object, the remoting system creates an object each time a client
method invokes a remote object. To register a server object as a Singleton object, you specify
the type of the object as WellKnownObjectMode.Singleton.
.NET asynchronous programming enables you to call and execute a method while the
program, which calls the methods, continues to execute. This enables methods to continue
executing without waiting for the called methods to finish execution, which increases the speed of
applications. .NET Remoting supports asynchronous programming.
COM/DCOM: Top
A COM component can be any type of external or internal object that is called to perform an
operation (uploading, error handling, etc...)
regsvr32 path\componentname
Ex: To register a component call Help.dll, located in C:\COMObjects folder
Regsvr32 "C:\COMObjects\Help.dll"
To unregister
Regsvr32 "C:\COMObjects\Help.dll" /u
MFC are supported in .NET by using the RCW (Runtime Callable Wrappers) class which wraps
the MFC and can be called from .NET framework.
2. Is a destructor virtual?
We need to make destructor virtual in the class if that class is being inherited by another class
which has its own destructor. Else there is no need to declare destructor as virtual.
Better known as Virtual Directory. Allows you to create multiple website under 1 ip address.
Allows you reference another location (folder) to include additional functionality.
10. What is a database index, how do you create one, discuss it's pros and cons.
VBScript
12.How do you use multiple record sets( rs.NextRecordSet ).
Using rs.NextRecordset
13. As soon as you fetch a record set, what operations would you perform.
Check to make sure records were returned...if so, then manipulate them.
· IIS Architecture
· IIS Deployment
· Administration
· Administration of Web Edition
· Command line Interface
· Creating and configuring FTP Sites
· Creating and configuring Web Sites
· Creating and configuring Web Applications
· Working with Metabase
· Trobleshooting and maintenance
ASP2. Top
Briefly explain how code behind works and contrast that using the inline
style.
- Can the action attribute of a server-side <form> tag be set to a value and if not how can you
possibly pass data from a form page to a subsequent page. (Extra credit: Have you heard of com
dna. :-)
- How would ASP and ASP.NET apps run at the same time on the same server?
UML Top
1. What is normalization? -
Well a relational database is basically composed of tables that contain related data. So the
Process of organizing this data into tables is actually referred to as normalization.
4. What is a trigger? - Triggers are basically used to implement business rules. Triggers is
also similar to stored procedures. The difference is that it can be activated when data is
added or edited or deleted from a table in a database.
5. What is a view?
If we have several tables in a db and we want to view only specific columns from specific
tables we can go for views. It would also suffice the needs of security some times allowing
specfic users to see only specific columns based on the permission that we can configure
on the view. Views also reduce the effort that is required for writing queries to access
specific columns every time.
6. What is an Index? - When queries are run against a db, an index on that db basically
helps in the way the data is sorted to process the query for faster and data retrievals are
much faster when we have an index.
7. What are the types of indexes available with SQL Server? - There are basically two types
of indexes that we use with the SQL Server. Clustered and the Non-Clustered.
8. What is the basic difference between clustered and a non-clustered index? - The
difference is that, Clustered index is unique for any given table and we can have only one
clustered index on a table. The leaf level of a clustered index is the actual data and the
data is resorted in case of clustered index. Whereas in case of non-clustered index the leaf
level is actually a pointer to the data in rows so we can have as many non-clustered
indexes as we can on the db.
9. What are cursors? - Well cursors help us to do an operation on a set of data that we
retreive by commands such as Select columns from table. For example : If we have
duplicate records in a table we can remove it by declaring a cursor which would check the
records during retreival one by one and remove rows which have duplicate values.
12. From where can you change the default port? - From the Network Utility TCP/IP
properties -> Port number.both on client and the server.
13. Can you tell me the difference between DELETE & TRUNCATE commands? - Delete
command removes the rows from a table based on the condition that we provide with a
WHERE clause. Truncate will actually remove all the rows from a table and there will be no
data in the table after we run the truncate command.
14. Can we use Truncate command on a table which is referenced by FOREIGN KEY? - No.
We cannot use Truncate command on a table with Foreign Key because of referential
integrity.
15. What is the use of DBCC commands? - DBCC stands for database consistency
checker. We use these commands to check the consistency of the databases, i.e.,
maintenance, validation task and status checks.
16. Can you give me some DBCC command options?(Database consistency check) -
DBCC CHECKDB - Ensures that tables in the db and the indexes are correctly linked.and
DBCC CHECKALLOC - To check that all pages in a db are correctly allocated. DBCC
SQLPERF - It gives report on current usage of transaction log in percentage. DBCC
CHECKFILEGROUP - Checks all tables file group for any damage.
18. Well sometimes sp_reanmedb may not work you know because if some one is using
the db it will not accept this command so what do you think you can do in such cases? - In
such cases we can first bring to db to single user using sp_dboptions and then we can
rename that db and then we can rerun the sp_dboptions command to remove the single
user mode.
19. What is the difference between a HAVING CLAUSE and a WHERE CLAUSE? - Having
Clause is basically used only with the GROUP BY function in a query. WHERE Clause is
applied to each row before they are part of the GROUP BY function in a query.
21. What is a Join in SQL Server? - Join actually puts data from two or more tables into a
single result set.
22. Can you explain the types of Joins that we can have with Sql Server? - There are three
types of joins: Inner Join, Outer Join, Cross Join
23. When do you use SQL Profiler? - SQL Profiler utility allows us to basically track
connections to the SQL Server and also determine activities such as which SQL Scripts
are running, failed jobs etc..
24. What is a Linked Server? - Linked Servers is a concept in SQL Server by which we can
add other SQL Server to a Group and query both the SQL Server dbs using T-SQL
Statements.
25. Can you link only other SQL Servers or any database servers such as Oracle? - We can
link any server provided we have the OLE-DB provider from Microsoft to allow a link. For
Oracle we have a OLE-DB provider for oracle that microsoft provides to add it as a linked
server to the sql server group.
26. Which stored procedure will you be running to add a linked server? -
sp_addlinkedserver, sp_addlinkedsrvlogin
27. What are the OS services that the SQL Server installation adds? - MS SQL SERVER
SERVICE, SQL AGENT SERVICE, DTC (Distribution transac co-ordinator)
28. Can you explain the role of each service? - SQL SERVER - is for running the databases
SQL AGENT - is for automation such as Jobs, DB Maintanance, Backups DTC - Is for
linking and connecting to other SQL Servers
29. How do you troubleshoot SQL Server if its running very slow? - First check the
processor and memory usage to see that processor is not above 80% utilization and
memory not above 40-45% utilization then check the disk utilization using Performance
Monitor, Secondly, use SQL Profiler to check for the users and current SQL activities and
jobs running which might be a problem. Third would be to run UPDATE_STATISTICS
command to update the indexes
30. Lets say due to N/W or Security issues client is not able to connect to server or vice
versa. How do you troubleshoot? - First I will look to ensure that port settings are proper
on server and client Network utility for connections. ODBC is properly configured at client
end for connection ----Makepipe & readpipe are utilities to check for connection. Makepipe
is run on Server and readpipe on client to check for any connection issues.
31. What are the authentication modes in SQL Server? - Windows mode and mixed mode
(SQL & Windows).
32. Where do you think the users names and passwords will be stored in sql server? -
They get stored in master db in the sysxlogins table.
33. What is log shipping? Can we do logshipping with SQL Server 7.0 - Logshipping is a
new feature of SQL Server 2000. We should have two SQL Server - Enterprise Editions.
From Enterprise Manager we can configure the logshipping. In logshipping the
transactional log file from one server is automatically updated into the backup database
on the other server. If one server fails, the other server will have the same db and we can
use this as the DR (disaster recovery) plan.
34. Let us say the SQL Server crashed and you are rebuilding the databases including the
master database what procedure to you follow? - For restoring the master db we have to
stop the SQL Server first and then from command line we can type SQLSERVER -m which
will basically bring it into the maintenance mode after which we can restore the master db.
35. Let us say master db itself has no backup. Now you have to rebuild the db so what
kind of action do you take? - (I am not sure- but I think we have a command to do it).
36. What is BCP? When do we use it? - BulkCopy is a tool used to copy huge amount of
data from tables and views. But it won't copy the structures of the same.
37. What should we do to copy the tables, schema and views from one SQL Server to
another? - We have to write some DTS packages for it.
38. What are the different types of joins and what dies each do?
42. What are three SQL keywords used to change or set someone's permissions?
43.
44. What is the difference between HAVING clause and the WHERE clause?
47. Which command using Query Analyzer will give you the version of SQL server and
operating system?
48. Using query analyzer, name 3 ways you can get an accurate count of the number of
records in a table?
51. What is one of the first things you would do to increase performance of a query? For
example, a boss tells you that “a query that ran yesterday took 30 seconds, but today it
takes 6 minutes”
52. What is an execution plan? When would you use it? How would you view the execution
plan?
53. What is the STUFF function and how does it differ from the REPLACE function?
54. What does it mean to have quoted_identifier on? What are the implications of having it
off?
55. What are the different types of replication? How are they used?
57. What is the difference between a Local temporary table and a Global temporary table?
How is each one used?
58. What are cursors? Name four types of cursors and when each one would be applied?
61. How do you load large data to the SQL server database?
62. How do you check the performance of a query and how do you optimize it?
63. How do SQL server 2000 and XML linked? Can XML be used to access data?
67. What is normalization and what are the different forms of normalizations?
70. What is better - 2nd Normal form or 3rd normal form? Why?
71. Can we rewrite subqueries into simple select statements or with joins? Example?
76. Can a stored procedure call another stored procedure. If yes what level and can it be
controlled?
77. Can a stored procedure call itself(recursive). If yes what level and can it be controlled.?
80. What is a table called, if it does not have neither Cluster nor Non-cluster Index?
88. How do we upgrade from SQL Server 6.5 to 7.0 and 7.0 to 2000?
93. What is the basic functions for master, msdb, tempdb databases?
97. How would you Update the rows which are divisible by 10, given a set of numbers in
column?
101. How will oyu test the stored procedure taking two parameters namely first name and
last name returning full name?
102. How do you find the error, how can you know the number of rows effected by last
SQL statement?
103. How can you get @@error and @@rowcount at the same time?
104. What are sub-queries? Give example? In which case sub-queries are not feasible?
105. What are the type of joins? When do we use Outer and Self joins?
110. If there is failure during updation of certain rows, what will be the state?