Friday, December 26, 2008

OOPS

What is Object Oriented Programming?
It is a problem solving technique to develop software systems. It is a technique to think real world in terms of objects. Object maps the software model to real world concept. These objects have responsibilities and provide services to application or other objects.
(B) What is a Class?
A class describes all the attributes of objects, as well as the methods that implement the behavior of member objects. It is a comprehensive data type, which represents a blue print of objects. It is a template of object.
(B) What is an Object?
They are instance of classes.It is a basic unit of a system. An object is an entity that has attributes,behavior, and identity. Attributes and behavior of an object are defined by the class definition.
(A) What is the relation between Classes and Objects?
They look very much same but are not same. Class is a definition, while object is a instance of the class created. Class is a blue print while objects are actual objects existing in real world. Example we have class CAR which has attributes and methods like Speed, Brakes, Type of Car etc. Class
CAR is just a prototype, now we can create real time objects which can be used to provide functionality. Example we can create a Maruti car object with 100 km speed and urgent brakes.

Following are characteristics of Object Oriented System’s:-
Abstraction
It allows complex real world to be represented in simplified manner. Example color is abstracted
to RGB. By just making the combination of these three colors we can achieve any color in world.
It is a model of real world or concept.
Encapsulation
It is a process of hiding all the internal details of an object from the outside world.
Communication using messages
When application wants to achieve certain task, it can only be done using combination of objects.
A single object cannot do all the task. Example if we want to make order-processing form. We
will use Customer object, Order object, Product object, and Payment object to achieve this
functionality. In short, these objects should communicate with each other. This is achieved when
objects send messages to each other.
Object lifetime
All objects have lifetime. Objects are created, and initialized, necessary functionalities are done
and later the object is destroyed. Every object have there own state and identity, which differ
from instance to instance.
Class hierarchies (Inheritance and aggregation)
Twist: - What is difference between Association, Aggregation, and Inheritance relationships?
In object, oriented world objects have relation and hierarchies in between them. There are three
kind of relationship in Object Oriented world:-
Association
This is the simplest relationship between objects. Example every customer has sales. So
Customer object and sales object have an association relation between them.
Aggregation
This is also called as composition model. Example in order to make a “Accounts” class it has use
other objects example “Voucher”, “Journal” and “Cash” objects. Therefore, accounts class is
aggregation of these three objects.
Inheritance
Hierarchy is used to define more specialized classes based on a preexisting generalized class.
Example we have VEHICLE class and we can inherit this class make more specialized class like
CAR, which will add new attributes and use some existing qualities of the parent class. Its shows
more of a parent-child relationship. This kind of hierarchy is called inheritance.
Polymorphism
When inheritance is used to extend a generalized class to a more specialized class, it includes
behavior of the top class (Generalized class). The inheriting class often implements a behavior
that can be somewhat different than the generalized class, but the name of the behavior can be
same. It is important that a given instance of an object use the correct behavior, and the property
of polymorphism allows this to happen automatically.

cross page posting

cross page posting
Note :- This is a new feature in ASP.NET 2.0
By default, button controls in ASP.NET pages post back to the same page that contains the
button, where you can write an event handler for the post. In most cases this is the desired
behavior, but occasionaly you will also want to be able to post to another page in your
application. The Server.Transfer method can be used to move between pages, however the URL
does not change. Instead, the cross page-posting feature in ASP.NET 2.0 allows you to fire a
normal post back to a different page in the application. In the target page, you can then access the
values of server controls in the source page that initiated the post back.
To use cross page posting, you can set the PostBackUrl property of a Button, LinkButton or
ImageButton control, which specifies the target page. In the target page, you can then access the
PreviousPage property to retrieve values from the source page. By default, the PreviousPage
property is of type Page, so you must access controls using the FindControl method. You can also
enable strongly-typed access to the source page by setting the @PreviousPageType directive in
the target page to the virtual path or Type name of the source page.
Here is a systematic guide for implementing the cross-page post back using controls that
implement the IButtonControl interface.
• Create a Web Form and insert a Button control on it using the VS .NET designer.
• Set the button's PostBackUrl property to the Web Form you want to post back. For
instance in this case it is "nextpage.aspx"

PostBackUrl="~/nextpage.aspx" Text="Post to nextpage" />
When the PostBackUrl property of the IButtonControl is set, the ASP.NET framework binds thecorresponding HTML element to new JavaScript function named
WebForm_DoPostBackWithOptions. The corresponding HTML rendered by the ASP.NET 2.0
will look like this:

Query String

Query String and What are benefits and limitations of
using Query Strings?
A query string is information sent to the server appended to the end of a page URL.
Following are the benefits of using query string for state management:-
• No server resources are required. The query string containing in the HTTP requests for a
specific URL.
• All browsers support query strings.
Following are limitations of query string:-
• Query string data is directly visible to user thus leading to security problems.-
• Most browsers and client devices impose a 255-character limit on URL length.
Below is a sample “Login” query string passed in URL
http://www.querystring.com/login.asp?login=testing.
This query string data can then be requested later by using Request.QueryString(“login”).

ViewState

What is ViewState?
Viewstate is a built-in structure for automatically retaining values amongst the multiple requests
for the same page. The viewstate is internally maintained as a hidden field on the page but is
hashed, providing greater security than developer-implemented hidden fields do.

benefits and Limitation of using Viewstate for state management
Following are the benefits of using Viewstate:-
• No server resources are required because state is in a structure in the page code.
• Simplicity.
• States are retained automatically.
• The values in view state are hashed, compressed, and encoded, thus representing a higher
state of security than hidden fields.
• View state is good for caching data in Web frame configurations because the data is
cached on the client.
Following are limitation of using Viewstate:-
• Page loading and posting performance decreases when large values are stored because
view state is stored in the page.
• Although view state stores data in a hashed format, it can still be tampered because it is
stored in a hidden field on the page. The information in the hidden field can also be seen
if the page output source is viewed directly, creating a potential security risk.
Below is sample of storing values in view state.
this.ViewState["EnterTime"] = DateTime.Now.ToString();

benefits and Limitation of using Hidden fields

benefits and Limitation of using Hidden fields
Following are the benefits of using Hidden fields:-
• They are simple to implement.
• As data is cached on client side, they work with Web Farms.
• All browsers support hidden field.
• No server resources are required.
Following are limitations of Hidden field:-
• They can be tampered creating a security hole.
• Page performance decreases if you store large data, as the data are stored in pages itself.
• Hidden fields do not support rich structures as HTML hidden fields are only single
valued. Then you have to work around with delimiters etc to handle complex structures.
Below is how you will actually implement hidden field in a project
runat="server"NAME="HiddenValue">

other ways to maintain state

What are the other ways you can maintain state?
Other than session variables, you can use the following technique to store state:
• Hidden fields
• View state
• Hidden frames
• Cookies
• Query strings

steps to configure SQLServer mode

What are the steps to configure SQLServer mode?
Following are the things to remember so that SQLSERVER Mode works properly:-
• SQLSERVER mode session data is stored in a different process so you must ensure that
your objects are serializable.
• IIS metabase (\LM\W3SVC\2) must be identical across all servers in that farm.
• By default Session objects are stored in “Tempdb”, you can configure it store outside
“TempDB” by running Microsoft provided SQL script.

various modes of storing ASP.NET session

Which are the various modes of storing ASP.NET session?
• InProc: - In this mode Session, state is stored in the memory space of the
Aspnet_wp.exe process. This is the default setting. If the IIS reboots or web application
restarts then session state is lost.
• StateServer:-In this mode Session state is serialized and stored in a separate process
(Aspnet_state.exe); therefore, the state can be stored on a separate computer(a state
server).
• SQL SERVER: - In this mode Session, state is serialized and stored in a SQL Server
database.
Session state can be specified in element of application configuration file. Using
State Server and SQL SERVER session state can be shared across web farms but note this comes
at speed cost as ASP.NET needs to serialize and deserialize data over network repeatedly.

different types of caching using cache object of ASP.NET?

What are different types of caching using cache object ofASP.NET?
You can use two types of output caching to cache information that is to be transmitted to and
displayed in a Web browser:
• Page Output Caching
Page output caching adds the response of page to cache object. Later when
page is requested page is displayed from cache rather than creating the
page object and displaying it. Page output caching is good if the site is
fairly static.
• Page Fragment Caching
If parts of the page are changing, you can wrap the static sections as user
controls and cache the user controls using page fragment caching.

Steps to Create a WebService








First, create a website by clicking on File -- New Website.
• From “Visual Studio Installed Templates” click on “Asp.NET Web Service”. See
figure below. Name the figure as “Mathis Web Service”.
By default, the .NET editor has made a default web service method called as "Hello
Word" which returns a string data type. Let us rename "Service.vb" to "Maths.vb"
and "Service.asmx" to "Maths.asmx". Let’s replace the “HelloWorld” with
following code below :-
_
Public Function AddTwoNumbers(ByVal Number1 As Integer, ByVal
Number2 As Integer) As Integer
Return Number1 + Number2
End Function
After the web service is done click on add Web reference. Normally for
components, we do an “Add Reference” and for Webservices, we do “Add Web
Reference”.
You will be shown with a list of web services, which are known to the solutions. As
we are looking for our “Maths” web service, which exist in the same solution, we
click “Web services in this solution”.

Your editor has located the “Maths” webservice.Select the web service
After you have clicked on “Maths” web service you will see a search progress bar
as shown in figure below. This process will start the web service, reference it and
create a proxy for the client, so that using it client can absorb the web service.
Finally, you are able to see your web service, which is ready for use. Click on Add Reference and
you will see a “Local host” reference in your .NET solution.
Figure: - 4.15 Starting the webservice and creating the proxy for your solution.
• We need to make a client who will absorb this “Maths Webservice”. Add
“WebserviceClient.aspx” and create a UI as shown below. In the button, click put in
the following code. “LocalHost.ClsMaths” is the proxy object by which you can
make calls to the webservice.

Sub cmdCalculate_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
Dim pobjMaths As New localhost.ClsMaths
lblResultDisplay.Text =
Convert.ToString(pobjMaths.AddTwoNumbers(Convert.ToInt16(txtNumber1.Tex
t), Convert.ToInt16(txtNumber2.Text)))
End Sub

Steps of acquiring a proxy object in Webservice

steps of acquiring a proxy object in Webservice?
Following are the different steps needed to get a proxy object of a web service at the client
side:-
• Client communicates to UDI node for Web Service either through browser or through
UDDI’s public web service.
• UDII responds with a list of web service.
• Every service listed by web service has a URI pointing to DISCO or WSDL document.
• After parsing the DISCO document, we follow the URI for the WSDL document related
to the web service, which we need.
• Client then parses the WSDL document and builds a proxy object, which can
communicate with Web service.

ObjRef object in remoting

What is ObjRef object in remoting?
All Marshal () methods return ObjRef object. The ObjRef is serializable because it implements
the interface ISerializable, and can be marshaled by value. The ObjRef knows about-
• location of the remote object
• host name
• port number
• Object name.

marshalling in .net

What is marshalling and what are different kinds of marshalling?
Marshaling is used when an object is converted so that it can be sent across the network or across
application domains. Unmarshaling creates an object from the marshaled data. There are two
ways to do marshalling:-
• Marshal-by-value (MBV):- In this, the object is serialized into the channel, and a
copy of the object is created on the other side of the network. The object to marshal
is stored into a stream, and the stream is used to build a copy of the object on the
other side with the unmarshalling sequence.
• Marshaling-by-reference (MBR):- Here it creates a proxy on the client that is
used to communicate with the remote object. The marshaling sequence of a remote
object creates an ObjRef instance that itself can be serialized across the network.
Objects that are derived from “MarshalByRefObject” are always marshaled by reference. All our
previous samples have classes inherited from “MarshalByRefObject”
To marshal a remote object the static method RemotingServices.Marshal () is
used.RemotingServices.Marshal () has following overloaded versions:-

Public static ObjRef Marshal (MarshalByRefObject obi)
Public static ObjRef Marshal (MarshalByRefObject obi, string objUri)
Public static ObjRef Marshal (MarshalByRefObject obi, string objUri,
Type requested Type)

The first argument obj specifies the object to marshal. The objUri is the path that is stored within
the marshaled object reference; it can be used to access the remote object. The requested Type
can be used to pass a different type of the object to the object reference. This is useful if the client
using the remote object should not use the object class but an interface that the remote object
class implements instead. In this scenario, the interface is the requested Type that should be used
for marshaling.

Saturday, December 6, 2008

How do we access viewstate value of this page in the next page ?

View state is page specific; it contains information about controls embedded on the particular
page. ASP.NET 2.0 resolves this by embedding a hidden input field name, __POSTBACK. This
field is embedded only when there is an IButtonControl on the page and its PostBackUrl property
is set to a non-null value. This field contains the view state information of the poster page. To
access the view state of the poster page, you can use the new PreviousPage property of the page:
Page poster = this.PreviousPage;

Label posterLabel = poster.findControl("myLabel");
string lbl = posterLabel.Text;

This cross-page post back feature also solves the problem of posting a Form to multiple pages,because each control, in theory, can point to different post back URL.

What are benefits and Limitation of using Viewstate for state management?

Following are the benefits of using Viewstate:-
• No server resources are required because state is in a structure in the page code.
• Simplicity.
• States are retained automatically.
• The values in view state are hashed, compressed, and encoded, thus representing a higher
state of security than hidden fields.
• View state is good for caching data in Web frame configurations because the data is
cached on the client.
Following are limitation of using Viewstate:-
• Page loading and posting performance decreases when large values are stored because
view state is stored in the page.
• Although view state stores data in a hashed format, it can still be tampered because it is
stored in a hidden field on the page. The information in the hidden field can also be seen
if the page output source is viewed directly, creating a potential security risk.
Below is sample of storing values in view state.
this.ViewState["EnterTime"] = DateTime.Now.ToString();

benefits and Limitation of using Hidden fields?

Following are the benefits of using Hidden fields:-
• They are simple to implement.
• As data is cached on client side, they work with Web Farms.
• All browsers support hidden field.
• No server resources are required.
Following are limitations of Hidden field:-
• They can be tampered creating a security hole.
• Page performance decreases if you store large data, as the data are stored in pages itself.
• Hidden fields do not support rich structures as HTML hidden fields are only single
valued. Then you have to work around with delimiters etc to handle complex structures.
Below is how you will actually implement hidden field in a project

runat="server"NAME="HiddenValue">

What are the major differences between Crystal and SQL reporting services?

Ease of hosting reports: - Using the URL technology in RS we can host reports more easily than
in crystal report where we need to make a UI for the same.
Supporting platforms: - Crystal can run on windows, IBM and sun while RS (reporting
services) can run only on windows environment.
Client tools: - In reporting services we have Business intelligence ( BI ) and development studio
while in crystal its Report designer.
Caching: - This achieved in crystal by using cache server while in reporting services it’s stored as
snapshots in Reportserver database.
Export formats:- In crystal we have HTML,PDF,Excel,XML,Word , PDF , RTF , CSV, text
files while in SQL Server 2005 we have all the formats above it also gives capability to extend
custom reporting formats.
Data sources:- Crystal support more data sources while RS only supports Microsoft and oracle
data sources. Crystal supports ADO, COM, Database excel Access, Exchange, NT, Xbase, JDBC,
File system and Paradox. RS supports only SQL Server, Oracle, ODBC, OLEDB and you can
also extend additional data sources which does not exists in crystal reports.
Version issues: - One of the main issues faced in crystal is it have different versions which makes
it difficult to use, while RS comes with SQL Server minimizing the version issue.
Web server support: - Crystal can run on IIS 5/6, Apache, lotus etc while RS works only with IIS 5.0 and above.

How can we get response text?How can we send request to the server using the XMLHttpRequest component?

• Abort ():- This method cancels a user request.
• getAllResponseHeaders ():- Returns a collection of HTTP headers as string. If you want
a specific header value, you can use getResponseHeader (“header name”)
• Open (“method”, “URL”, “async”, “uname”, “pswd”):- This method takes a URL and
other values needed for a request. You can also specify how the request is sent by GET,
POST, or PUT. One of the important values is how this request will be sent
asynchronously or synchronously. True means that processing is carried after the send ()
method, without waiting for a response. False means that processing is waits for a
response before continuing.
• Send (content):- Sends a request to the server resource.
• SetRequestHeader (“label”,” value”):- Sets label value pair for a HTTP header.
• Onreadystatechange: - This is a event handler, which fires at every state change.
• Ready State: - Returns the current state of the object.
0 = uninitialized
1 = loading
2 = loaded
3 = interactive
4 = complete
If you want to check the state use if (xmlHttpObj.readyState ==4).
• Response Text: - Returns the response in plain string.
• Response: - Returns the response as XML. Therefore, this gives us DOM object model,
which can then be traversed.
• Status: - Returns the status as a numeric For instance 404 for "Not Found" or 200 for
"OK", 500 for "Server Error" etc.
• Status Text: - Returns the status as a string. For instance, "not found" or "OK".

Bukt Update and Delete form GridView

foreach (GridViewRow gr in GridView1.Rows)
{
CheckBox chk = (CheckBox)gr.FindControl("CheckBox1");
if (chk.Checked == true)
{
// string sno = (CheckBox)gr.FindControl("CheckBox1");
Label Label3 = (Label)gr.FindControl("Label3");
// int ItemValue = int.Parse(sno);
// string iteemval = Label3.Text;
centers filgrd = new centers();
DAL dl = new DAL();
SqlConnection cn = dl.Getconnection();
SqlCommand cmd = new SqlCommand("Delete * from Student_details where sno="+Label3.Text+"",cn);
cn.Open();
try
{
cmd.ExecuteNonQuery();
// Page.RegisterStartupScript("aa", "");
DataSet ds = filgrd.get_studenet(DropDownList4.SelectedIndex, DropDownList2.SelectedIndex, DropDownList3.SelectedIndex);
GridView1.DataSource = ds;
GridView1.DataBind();
Label2.Text = "No Records Found..";

}
catch (Exception ex)
{
}
finally
{
cn.Close();
}
}

Wednesday, December 3, 2008

I Soft Interview Questions & Online Test

1) By default, the number of active connections in the queue waiting for server attention is 25. During heavy load, you can increase this to: a) (your answer) 50 - correct answer b) 64 c) 80 d) 120 e) 100
________________________________________
2) This is NOT a good trick for improving performance: a) Minimize FTP user isolation. b) Use ISAPI extensions instead of ISAPI filters. c) Set up remote virtual directories. - correct answer d) (your answer) Keep websites and FTP servers on different machines.
________________________________________
3) IIS 6 supports how many concurrent CGI applications by default? a) (your answer) 2 b) 4 - correct answer c) 6 d) 7 e) 8
________________________________________
4) IIS has a feature for monitoring the health of multiple worker processes servicing an application pool called: a) HTTP keep-alive b) (your answer) IS monitoring services c) Application failsafe d) Rapid-fail protection - correct answer
________________________________________
5) When looking at the Memory:pages/sec-counter, a number under 20 indicates: a) Everything is just fine and dandy; have some coffee and relax. - correct answer b) You need more RAM. c) Compare the number to the network card bandwidth to locate possible bottlenecks. d) (your answer) Increase the cache allotment.
________________________________________
6) This tool simulates multiple browsers simultaneously connecting to IIS to get content or run apps: a) (your answer) Web Application Stress Tool - correct answer b) Microsoft Operations Manager c) Traffic Volume Manager Tool d) Microsoft Traffic Management Tool
________________________________________
7) HTTP compression only works with web browsers developed after: a) (your answer) 1996 b) 1997 c) 1998 - correct answer d) 1999 e) 2000
________________________________________
8) Application pool settings do NOT apply to this type of applications. a) (your answer) ISAPI b) CGI - correct answer c) ASP d) ASP.NET
________________________________________
9) This is NOT a good way to boost ASP.NET application performance: a) Trap exceptions instead of using them to direct program flow. b) Disable session state, unless you actively plan to use it. c) Use storied procedures instead of ad hoc queries when accessing back-end SQL data. d) (your answer) Never leave caching turned on. - correct answer
________________________________________
10) What's a good way to ensure your paging file doesn't become fragmented? a) Make the paging file size dynamic. b) Make the paging file size static. c) Make the paging file large and keep it on a single drive. - correct answer d) (your answer) Install MPDFRG.EXE and set it to run automatically.
________________________________________

1) What does SQL stand for? a) Strong Question Language b) Structured Question Language c) (your answer) Structured Query Language - correct answer
________________________________________
2) Which SQL statement is used to extract data from a database? a) GET b) OPEN c) (your answer) EXTRACT d) SELECT - correct answer e) QUERY
________________________________________
3) Which SQL statement is used to update data in a database? a) (your answer) UPDATE - correct answer b) SAVE AS c) MODIFY d) SAVE
________________________________________
4) Which SQL statement is used to delete data from a database? a) TRUNCATE b) (your answer) DELETE - correct answer c) REMOVE
________________________________________
5) Which SQL statement is used to insert new data in a database? a) ADD RECORD b) ADD INTO c) (your answer) INSERT - correct answer d) ADD NEW
________________________________________
6) With SQL, how do you select a column named "FirstName" from a table named "Persons"? a) EXTRACT FirstName FROM Persons b) (your answer) SELECT FirstName FROM Persons - correct answer c) SELECT Persons.FirstName
________________________________________
7) With SQL, how do you select all the columns from a table named "Persons"? a) SELECT [all] FROM Persons b) SELECT All Persons c) SELECT *.Persons d) (your answer) SELECT * FROM Persons - correct answer
________________________________________
8) With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" is "Peter"? a) SELECT [all] FROM Persons WHERE FirstName='Peter' b) SELECT * FROM Persons WHERE FirstName LIKE 'Peter' c) SELECT [all] FROM Persons WHERE FirstName LIKE 'Peter' d) (your answer) SELECT * FROM Persons WHERE FirstName='Peter' - correct answer
________________________________________
9) With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" starts with an "a"? a) (your answer) SELECT * FROM Persons WHERE FirstName='%a%' b) SELECT * FROM Persons WHERE FirstName LIKE '%a' c) SELECT * FROM Persons WHERE FirstName='a' - correct answer d) SELECT * FROM Persons WHERE FirstName LIKE 'a%' e) SELECT * FROM Persons WHERE FirstName='a'"
________________________________________
10) The OR operator displays a record if ANY conditions listed are true. The AND operator displays a record if ALL of the conditions listed are true a) (your answer) True - correct answer b) False
________________________________________
11) With SQL, how do you select all the records from a table named "Persons" where the "FirstName" is "Peter" and the "LastName" is "Jackson"? a) SELECT * FROM Persons WHERE FirstName LIKE 'Peter' AND LastName LIKE 'Jackson' b) (your answer) SELECT * FROM Persons WHERE FirstName='Peter' AND LastName='Jackson' - correct answer c) SELECT FirstName='Peter', LastName='Jackson' FROM Persons
________________________________________
12) With SQL, how do you select all the records from a table named "Persons" where the "LastName" is alphabetically between (and including) "Hansen" and "Pettersen"? a) SELECT LastName>'Hansen' AND LastName<'Pettersen' FROM Persons b) (your answer) SELECT * FROM Persons WHERE LastName BETWEEN 'Hansen' AND 'Pettersen' - correct answer c) SELECT * FROM Persons WHERE LastName>'Hansen' AND LastName<'Pettersen'
________________________________________
13) Which SQL statement is used to return only different values? a) (your answer) SELECT UNIQUE b) SELECT INDENTITY c) SELECT DIFFERENT d) SELECT DISTINCT - correct answer
________________________________________
14) Which SQL keyword is used to sort the result-set? a) (your answer) SORT BY b) ORDER c) ORDER BY - correct answer d) SORT
________________________________________
15) With SQL, how can you return all the records from a table named "Persons" sorted descending by "FirstName"? a) (your answer) SELECT * FROM Persons SORT BY 'FirstName' DESC b) SELECT * FROM Persons ORDER BY FirstName DESC - correct answer c) SELECT * FROM Persons ORDER FirstName DESC d) SELECT * FROM Persons SORT 'FirstName' DESC
________________________________________
16) With SQL, how can you insert a new record into the "Persons" table? a) (your answer) INSERT INTO Persons VALUES ('Jimmy', 'Jackson') - correct answer b) INSERT ('Jimmy', 'Jackson') INTO Persons c) INSERT VALUES ('Jimmy', 'Jackson') INTO Persons
________________________________________
17) With SQL, how can you insert "Olsen" as the "LastName" in the "Persons" table? a) (your answer) INSERT INTO Persons (LastName) VALUES ('Olsen') - correct answer b) INSERT ('Olsen') INTO Persons (LastName) c) INSERT INTO Persons ('Olsen') INTO LastName
________________________________________
18) How can you change "Hansen" into "Nilsen" in the "LastName" column in the Persons table? a) UPDATE Persons SET LastName='Hansen' INTO LastName='Nilsen' b) (your answer) UPDATE Persons SET LastName='Nilsen' WHERE LastName='Hansen' - correct answer c) MODIFY Persons SET LastName='Hansen' INTO LastName='Nilsen d) MODIFY Persons SET LastName='Nilsen' WHERE LastName='Hansen'
________________________________________
19) With SQL, how can you delete the records where the "FirstName" is "Peter" in the Persons Table? a) (your answer) DELETE FROM Persons WHERE FirstName = 'Peter' - correct answer b) DELETE ROW FirstName='Peter' FROM Persons c) DELETE FirstName='Peter' FROM Persons
________________________________________
20) With SQL, how can you return the number of records in the "Persons" table? a) SELECT COLUMNS() FROM Persons b) (your answer) SELECT COUNT(*) FROM Persons - correct answer c) SELECT COLUMNS(*) FROM Persons d) SELECT COUNT() FROM Persons
________________________________________
21) Given an employees table as follows: empid name managerid a1 bob NULL b1 jim a1 B2 tom a1 What value will select count(*) from employees return? a) 1 b) (your answer) 2 c) 3 - correct answer d) none of the above
________________________________________
22) The result of a SELECT statement can contain duplicate rows. a) (your answer) True - correct answer b) False
________________________________________
23) Sometimes the expression "select count(*)" will return fewer rows than the expression "select count(value)". a) True b) (your answer) False - correct answer
________________________________________
24) What type of lock will deny users any access to a table? a) EXPLICIT b) IMPLICIT c) EXCLUSIVE - correct answer d) SHARED e) (your answer) READ ONLY
________________________________________
25) Which of the following is the correct SQL statement to use to remove rows from a table? a) DROP b) (your answer) REMOVE ROW c) DELETE - correct answer d) DELETE ROW
________________________________________
26) The only way to join two tables is by using standard, ANSI syntax. a) (your answer) True b) False - correct answer
________________________________________
27) A NULL value is treated as a blank or 0. a) True b) (your answer) False - correct answer
________________________________________
28) The left outer join is one type of outer join. Another one is the. a) right b) full c) (your answer) right outer d) full outer e) all of the above - correct answer
________________________________________

1) What will be the output of the following statement? SELECT LEN(CAST(LEFT('026-100', 3) AS INT)) a) 2 - correct answer b) (your answer) 3 c) 7 d) Statement will generate an error.
________________________________________
2) What will be the output of the following statement? SELECT CAST(-1 AS SMALLDATETIME) a) 1900-01-01 00:00:00.000 b) 1899-01-01 00:00:00.000 c) 1752-01-01 00:00:00.000 d) (your answer) The system will generate an error. Only positive integer values can be converted to a SMALLDATETIME data type. - correct answer
________________________________________
3) What will be the output of the following statement? SELECT ROUND(123.89, -1) a) 120.00 - correct answer b) (your answer) 123.00 c) 123.90 d) 124.00
________________________________________
4) What will be the output of the following statement? SELECT STR(6365, 3) a) *** - correct answer b) (your answer) 6365 c) 6,365 d) 6400 e) 6365.000
________________________________________
5) What will be the output of the following statement? SET ARITHABORT OFF SET ANSI_WARNINGS OFF SELECT 100/0 a) Null - correct answer b) 0 c) Infinity d) (your answer) An error is generated.
________________________________________
6) View text definitions are stored in which system table? a) (your answer) sysobjects b) syscolumns c) syscomments - correct answer d) sysviews
________________________________________
7) What's the maximum value can an INT data type hold? a) 2,147,483,647 - correct answer b) 2,147,483,648 c) 4,294,967,295 d) (your answer) 4,294,967,296
________________________________________
8) What is the best data type to store the birthdays of the US Presidents, starting with George Washington's birthday of February 22, 1732? a) DATETIME b) INT - correct answer c) SMALLDATETIME d) (your answer) VARCHAR
________________________________________
9) Which of the following is NOT a valid description of the public role? a) The public role captures all default permissions for users in a database. b) The public role cannot be dropped. c) The public role is contained in every database, including msdb, tempdb, model, and all user databases except in the master database for security purposes. - correct answer d) (your answer) The public role cannot have users, groups, or roles assigned to it.
________________________________________
10) What is the maximum date value that can be stored in a SMALLDATETIME data type? a) June 6, 2079 - correct answer b) July 6, 2079 c) December 31, 2079 d) (your answer) December 31, 9999

1) Your SQL Server is running SQL 6.5 and you want to transfer the data from the SQL 6.5 server to a new SQL 7 Server. How can you do this? a) Using DTS Import b) Using bcp -out and use bcp -in to insert the data into the new SQL 7 Server c) Use the DTS Export d) Using bcp -copy, copy the data from the SQL 6.5 Server to the SQL 7 Server e) (your answer) Both A and B - correct answer
________________________________________
2) You start SQL-Server with the -f option. Unfortunately now you can't establish a connection to your SQL-Server. What should you do? a) (your answer) Rebuild Master database b) Edit registry c) Run regrebld.exe - correct answer d) Restore registry from backup
________________________________________
3) What SQL Server protocol must be installed to communicate via SQL Server with a Unix application? a) TCP/IP - correct answer b) Unix Command Protocol c) (your answer) Multiprotocol d) Named Pipes
________________________________________
4) You friend is trying to familiarize herself with the DBCC commands with SQL server. Which command can she/he use to check if indexes are in the proper sorted order and if page offsets are reasonable? a) DBCC CHECKDB - correct answer b) DBCC NEWALLOC c) DBCC CHECKALLOC d) (your answer) DBCC CHECKCATALOG
________________________________________
5) The SQL server that you've manages crashed. The disk drives were not damaged but there was data that had not been written to some databases. Which transactions will be rolled forward in each database when his SQL server starts the automatic recovery proce a) All committed transactions that are in the transaction log b) All uncommitted transactions that are in the transaction log c) (your answer) All committed transactions that are in the transaction log between the last checkpoint and the failure - correct answer d) All committed transactions that are in the transaction log between the last two checkpoints
________________________________________
6) You want to prevent long-running queries from executing. How would you do this? a) Run the stored procedure set query governor cost limit. b) Modify the configuration parameter min memory per query. c) (your answer) Modify the configuration parameter show advanced options. d) Modify the configuration parameter query governor cost limit. e) Both C and D - correct answer
________________________________________
7) You've just installed SQL Server 7 on a NT server using the Typical Installation option. When you start SQL for the first time, you get an error and it will not start. Where is one place you would check to see what is causing the error? a) C:MSSQL7LOGERROR.LOG b) C:MSSQL7ERROR.LOG c) C:MSSQL7SQLSTP.LOG d) (your answer) Windows NT Event Log-Application Log - correct answer e) Windows NT Event Log-System Log
________________________________________
8) Under what occasions does the SQL Server 7 write events to the Windows NT application log? a) When the xp_logevent stored procedure is invoked b) When sp_addmessage or sp_altermessage define errors to be written to the NT application log c) When SQL Server errors occur with severity levels between 19 and 25 d) (your answer) When the RAISEERROR WITH LOG statement is executed e) All of the above - correct answer
________________________________________
9) After installing SQL 7, you want to connect to the SQL 7 Server to verify installation. What graphical tools would you use to verify that the server is running? a) SQL Server Enterprise Manager b) SQL Server Transact c) (your answer) SQL Server Network Client d) SQL Server Query Analyzer e) Both A and D - correct answer
________________________________________
10) What functions are performed by the SQL Server Agents? a) Replication management b) Job execution c) Notification d) Alert management e) (your answer) All of the above - correct answer
________________________________________
11) You define full-text indexing on the ProductName column in the Products table. You then execute a full-text query on the column. You specify a word that you know is present in the column, but the result set is empty. What is the most likely cause? a) The catalog is not populated - correct answer b) You did not create a unique SQL Server index on the ProductName column c) The SQL ServerAgent Service is not running d) (your answer) The Microsoft Service is not running
________________________________________
12) A client connecting to a SQL Server database from a Windows 98 workstation is able to connect in a Windows NT authentication mode. True or false? a) (your answer) True b) False - correct answer
________________________________________
13) John Doe has SQL Server 4.2 and she wants to upgrade the server, data and database objects to SQL Server 7. Which upgrade path will accomplish this goal? a) (your answer) Just upgrade normally to SQL Server 7 b) Use SQL 6.5 Transfer Management Tool to push the data and objects from version 4.2 to 7 c) Upgrade the server to SQL Server 6.5, then upgrade again to SQL Server 7 - correct answer d) Use the DTS to transfer the data and objects
________________________________________
14) John Doe wants to establish a replication model that will allow three branch offices to update data at the corporate site. Which replication model should John Doe use? a) Remote replication b) (your answer) Snapshot replication c) Transactional replication d) Merge replication - correct answer

15) Which of the following SQL Server services are installed during the Typical installation option on a NT Server? a) SQL Server Agent b) MS DTC c) MSSQL Server d) (your answer) All of the above - correct answer

16) Exchange and SQL 7.0 are running on the same server. You notice the performance in exchange is degraded. The Min server memory, Maximum server memory and set working area are set as they were automatically in the installation. What do you do to free memor a) (your answer) Increase Min server memory - correct answer b) Set working area to 1 c) Set working area to 0 d) Increase memory allocated to the procedure cache option e) Reduce Min server memory

17) The step object in a DTS (data transformation service) package can run in parallel when there are no precedence constraints on it. Which of the following are step object precedence constraints? a) (your answer) On failure b) Return codes c) On success d) All of the above - correct answer

18) Which of the four system databases stores all the information about alerts and jobs? a) (your answer) Msdb - correct answer b) Tempdb c) Master d) Model

19) You have been asked to copy a one-table Access database to another table that exists in a SQL Server 7 database. What is the best method you should use to copy the data? a) The copy_db command at a command prompt b) Data Transformation Services - correct answer c) The oslp utility d) (your answer) Data Transfer System e) The BULK INSERT statement

20) You must restore the MASTER database from a backup on a SQL 7 computer. You attempt to start the restore process but receive an error message. What must you do before you can restore the MASTER database? a) (your answer) Run the rebuild.exe program b) Drop the MASTER database c) Run the reblddb.exe program d) Run the sqlservr.eve program with the -m option - correct answer

1) You are a junior web designer. Your company assigns you to work on a JavaScript project. Which of the following are the advantages of using JavaScript for form validation? a) Conservation of client CPU resources b) Increased validity of form submission c) Conservation of bandwidth d) Increase end-user satisfaction e) (your answer) Either BCD - correct answer

2) Your company assigns you to work on a JavaScript project. With the DATE object, which of the following allows you to call a function based on an elapsed time? a) (your answer) setElapsedTime() b) Timeout() c) setTimeout() d) setTime() - correct answer

3) You are working on a JavaScript project. What is used to restart the inner most loop? a) Abort b) (your answer) Breakloop c) Stop d) Continue label - correct answer

4) You work on a JavaScript project. Which of the following correctly describe the relationships of JavaScript and "objects"? a) JavaScript is Object-oriented b) JavaScript is Object-based - correct answer c) JavaScript is Object-driven d) (your answer) JavaScript has no relationship with objects

5) You work on a JavaScript project. How do you prompt users with messages and at the same time requesting user inputs? a) Alert() b) Display() c) Prompt() - correct answer d) (your answer) Confirm()

6) Which of the following is the correct syntax of FOR? a) for ( increment; initialize; test) b) for ( initialize; test), increment c) (your answer) for ( initialize; test; increment) - correct answer d) for ( test; initalize; increment)

7) In your JavaScript code, how do you find out which character occurs at the 5th position in a string "How are you"? a) Substring() b) String() c) Stringlength() d) (your answer) CharAt() - correct answer

8) Which of the following do you use for a multi-way branch? a) If b) Ifthen c) Ifelse d) (your answer) switch - correct answer e) for

9) You want to design a form validation mechanism. Using string methods, which of the following are the steps involved ? a) Check for the presence of certain characters b) Check the position of substrings c) Test the length of data d) (your answer) Check the variable type of the strings e) Either ABC - correct answer

10) Which of the following is the minimum browser version that supports JavaScript a) Navigator v2.0 - correct answer b) Mozilla V1.5 c) (your answer) IE 2.0 d) Navigator V1.0

11) Under which of the following conditions will you need to include semi colons on a line of code? a) When you have multiple statements on multiple lines b) (your answer) When you have multiple statements on a line - correct answer c) When you have single statement on multiple lines d) When you have single statement on a line

12) Which of the following are the valid JavaScript versions? a) Version 1.2 b) Version 1.1 c) Version 1.3 d) Version 1.4 e) (your answer) All of the above - correct answer

13) Which of the following languages will you consider as being similar to JavaScript? a) C b) (your answer) C++ c) Pascal d) PHP e) Either A & C - correct answer

14) You plan the coding of your project. When must the object references be ready? a) (your answer) at run time - correct answer b) at compile time c) at debug time d) at code time

15) Which of the following correctly describe cookies ? a) Often referred to as "persistent cookies" b) Often referred to as "persistent HTML" c) Small memory-resident pieces of information sent from a server to the client d) (your answer) Small memory-resident pieces of information sent from a client to the server e) Either AB&C - correct answer

16) A program written by JavaScript is driven by a) (your answer) Events - correct answer b) Classes c) Objects d) DLL e) Components

17) What are JavaScript relations with the underlying operating platform? a) Platform dependent b) Platform linkage c) (your answer) Platform independent - correct answer d) Platform binding

18) When you plan for the JavaScript variable names, the first character must be? a) Underscore b) Comma c) Hyphen d) Letter e) (your answer) Either A&D - correct answer

19) Which of the following correctly describe JavaScript as a language? a) It is based on object creation b) It focuses on component building c) It focuses on logic flow d) (your answer) It emphasis on SCRIPTING - correct answer

20) When authoring web page with Javascript, why should you explicitly include the window object into your codes? a) this is a good practice - correct answer b) (your answer) this is REQUIRED c) this ensures browser compatibility d) this ensures OS compatibility

1) Which of the following is a tool used to secure expert judgment? a) (your answer) Peer Review b) Expected value technique c) Delphi Technique - correct answer d) Work Breakdown Structure (WBS)

2) What should be done by the project manager to ensure that all work in the project is included? a) Create a contingency plan b) Create a risk management plan c) Create a WBS - correct answer d) (your answer) Create a scope statement

3) What kind of a relationship is implied when completion of a successor is dependent on initiation of its predecessor? a) (your answer) FS b) FF c) SS d) SF - correct answer

4) What should a project manager do or follow to ensure clear boundaries for project completion? a) Scope verification b) Completing a scope statement - correct answer c) (your answer) Risk management plan d) scope definition

5) Which of the following provides the foundation for team development? a) (your answer) Motivation b) Organizational development c) Conflict management d) Individual development - correct answer

6) Which of the following is NOT an input to project plan execution? a) (your answer) Work authorization system - correct answer b) Project plan c) Corrective action d) Preventive action

7) A project manager would find team development the most difficult in which form of organization? a) (your answer) Weak Matrix organization - correct answer b) Balanced Matrix organization c) Projectized organization d) Tight Matrix organization

8) Once the project is complete, the complete set of project records should be put in which of the following? a) (your answer) Project archives - correct answer b) Database c) Storage room d) Project report

9) Which of the following is a common format for performance reporting? a) Pareto diagrams b) Bar charts - correct answer c) (your answer) Responsibility assignment matrices d) Control charts

10) f the cost variance is positive and the schedule variance is also positive, then it indicates that … a) Project is under budget and behind schedule - correct answer b) Project is over budget and behind schedule c) (your answer) Project is under budget and ahead of schedule d) Project is over budget and ahead of schedule

11) Which one of the following is the last step of project closing? a) Client appreciates your product b) Client has accepted the product c) Lessons learned are documented d) (your answer) Archives are complete - correct answer

12) Who should be involved in the creation of lessons learned, at closure of project? (choose the BEST answer) a) Project office b) Management of the performing organization c) (your answer) Project team d) Stakeholders - correct answer

Ajax Faqs

How can we pass parameters to workflow?
ATLAS-AJAX
What problem does Ajax solve?
What is Ajax?
What is the fundamental behind Ajax?
What is JSON?
How do we use XMLHttpRequest object in JavaScript?
How do we do asynchronous processing using Ajax?
What are the various states in XMLHttpRequest and how do we check the same?

How can we get response text?
How can we send request to the server using the XMLHttpRequest component?

How do we pass parameters to the server?
How can we create a class in JavaScript using Atlas?
How do we do inheritance-using Atlas?.
How do we define interfaces using Atlas?
How do we reference HTML controls using Atlas?
Can you explain Scriptmanager control in Ajax?
Can you explain Enablepartialrendering and UpdatePanel control in Ajax?
Can you explain the concept of triggers in ‘UpdatePanel’ control?
Can you explain the ‘UpdateProgress’ component?
How can you do validations in Ajax?
How do we do exception handling in Ajax?
How do we consume web service in Atlas?
How can we consume data directly in web services?

Tuesday, December 2, 2008

.net Faqs

What is an IL?
What is a CLR?
What is CTS?
What is a CLS (Common Language Specification)?
What is a Managed Code?
What is a Assembly?
What are the different types of Assembly?
What is NameSpace?
What is Difference between NameSpace and Assembly?
If you want to view an Assembly how do you go about it?
What is Manifest?
Where is version information stored of an assembly?
Is versioning applicable to private assemblies?
What is GAC?
what is the concept of strong names?
How to add and remove an assembly from GAC?
What is Delay signing?
What is garbage collection?
Can we force garbage collector to run?
What is reflection?
What are different types of JIT?
What are Value types and Reference ? What is concept of Boxing and Unboxing ?
What is the difference between VB.NET and C#?
what is the difference between System exceptions and Application exceptions?
What is CODE Access security?
What is a satellite assembly?
How to prevent my .NET DLL to be decompiled?
what is the difference between Convert.toString and .toString () method?
What is Native Image Generator (Ngen.exe)?
If we have two version of same assembly in GAC how do we make a choice?
What is CodeDom?

Biztalk Server Faqs2

Q.What IT benefits can we realize from installing BizTalk Server?
A.
Automating and managing your connections with trading partner applications and applications within your organization is a time consuming process, and BizTalk Server’s reusable integration services speeds deployment time, helping reduce IT administrative effort. Once these connections are made, BizTalk Server provides a single tool to create business processes and monitor them in real time, as well as to extract business intelligence, simplifying both IT workloads and reducing management overhead. And because BizTalk Server uses standards like XML and web services, IT administration is less complex.
Q.Why should we choose a Microsoft business process management solution?
A.
Microsoft’s BizTalk Server offers great economics in business process management technologies, enabling midsize companies to install, configure and customize their BPM solution easily and affordably. Developers who are familiar with Microsoft tools will quickly become productive. And by using a common set of reusable services, organizations can reduce the costs and time to value of business process automation, while at the same time simplifying management and maintenance costs. In addition, by using BizTalk Server to provide BPM within your organization and between your trading partners, you also benefit from the long list of partners that have helped to make Microsoft’s solution one of the most versatile in the industry. Thousands of systems and devices are supported on the Microsoft platform, as well as over 2500 applications. Microsoft’s strong relationships with leading global and regional systems integrators has allowed us to deliver tailored solutions for every industry in every geography.
Q.We are looking for a business process management solution that our key business personnel can readily use. Does BizTalk Server provide easy-to-obtain and readily useable business intelligence?
A.
BizTalk Server makes it easy to bridge the gap between what business users need to know and the underlying technology that IT staff orchestrate to make the software give you what you need. BizTalk Server allows you to map out business processes in a graphical format, making it straightforward for business personnel to understand, analyze and adjust business processes throughout the organization. Behind the scenes, IT staff map the graphical representation of each business process into simple XML schemas that make the integration process work. Once the business processes are set up, users can readily monitor business activities to obtain real-time information about the status of any business process, as well as receive notifications about any event or milestones of interest. Such output can easily be integrated with SharePoint and Excel (using a wizard), to provide graphical data output as well.
Q.What is the difference between accelerators and adapters, and how do we know if our company needs them?
A.
BizTalk adapters extend the functionality of BizTalk Server, enabling it to connect to other servers, applications and Web services. Specifically, they remove the need to develop infrastructure components such as network protocol support and translation, data conversion, data transformation, in the development of business process automation solutions. BizTalk Server adapters are "no-code" connectivity solutions, and are provided in-box with BizTalk Server 2006.
BizTalk accelerators provide developers with tools, data schemas, and processes to help significantly reduce the time required to develop a custom business solution in specific industries, such as health care, financial services, and supply-chain management. If you are required to comply with specific industry standards, you will likely require an accelerator.

Biztalk Server Faqs 1

Q.What is BizTalk Server?
A.
BizTalk is a Business Process Management Server designed to connect the people, processes and information that you need to effectively manage and grow your business. By connecting applications within and between organizations, and providing the tools to let business staff define, create and modify the business processes that depend on that software, BizTalk Server provides real-time visibility into critical business functioning, maximizing your organizational agility. BizTalk Server 2006 is the fourth major release of the product, and offers dependable, scalable and enterprise-ready business process management.
Q.What does Business Process Management (BPM) mean?
A.
Business process management refers to the automation of manual processes and the subsequent optimization of those processes. The goal of management is to improve the flow of business processes such that efficiencies are improved, risks are lessened and costs are lower.
Components of Microsoft’s Business Process Management Solutions

Business Process Management
Tools and technologies to manage business processes that span applications and organizational boundaries.
Application Integration
Internal application integration within an enterprise using either standard or proprietary communication protocols
Business-to-Business Integration
External integration with trading partners, customers or suppliers using either standard or proprietary communication protocols
Q.What is Microsoft’s business process management strategy?
A.
Early business process automation approaches were comprised of many independent technologies that separately met needs for business process management and integration, but together were expensive and hard to manage. Microsoft’s strategy has been to align these technologies, enabling organizations to more readily automate and optimize processes, thereby improving efficiencies, decreasing costs and improving business value.
Q.Our company isn’t a large enterprise. Why would it be important for us to automate and manage our businesses processes?
A.
More and more large customers and suppliers are demanding that the businesses in their supply chain automate in order to eliminate inefficiencies and reduce costs. While these mandates and government regulations impose a burden on small and midsize companies, achieving compliance (with Sarbanes-Oxley Act, for example) promotes business process transparency and better process controls, both of which can greatly benefit the organization. If a business analyst needs to exchange information with a trading partner, or needs to obtain information that resides within the company but on different computer systems, applications, or in different parts of the organization, then business process automation and management—both between and within businesses—can provide the solution.
Q.
What business advantages can BizTalk Server offer midsize companies?
A.
BizTalk Server provides a single solution for business process management, enabling companies to effectively communicate both within organizations and between trading partners. BizTalk Server not only connects legacy systems and applications together, it also lets you define your organizational business processes, connect the process to the people and systems, and manage the events and key performance indicators within each process in order to ensure that the business is running effectively and efficiently.

PayPal intigration


I recently have been setting up an ecommerce site from the ground up. One of the task at hand was to incorporate Paypal as a method to the checkout process. Paypal offers many ways to do this. From APIs that process the credit cards on your site to passing off variables over, to simply adding a buy now button on each product.

Basic Steps

1. Sign up for a PayPal account. They have personal, premier, and business accounts. You will need to upgrade to a premier or business account to accept credit cards. PayPal is always happy to let you upgrade.
2. Download the source code above
3. Put in your PayPal email address in the SendPayPal.aspx page
4. Tailor the Master Page to have the look desired
5. Add your products to the xml file
6. Add your pictures to the pictures folder

These are fileds in the hidden type which was provided by Paypal, these are the default parameters ,we couldn't the change those names.

Friday, November 7, 2008

About GC and Reflection

Garbage collection is a CLR feature, which automatically manages memory. Programmers forget to release the objects while coding ... Laziness (Remember in VB6 where one of the good practices is to set object to nothing). CLR automatically releases objects when they are no longer in use and refernced. CLR runs on non-deterministic to see the unused objects and cleans them.One side effect of this non-deterministic feature is that we cannot assume an object is destroyedwhen it goes out of the scope of a function. We should avoid using destructors because before GCdestroys the object it first executes destructor in that case it will have to wait for code to release the unmanaged resource. This results in additional delays in GC. So it is recommended to implement IDisposable interface, write cleanup code in Dispose method, and call GC.SuppressFinalize method. Its like instructing GC not to call your constructor.

System.GC.Collect () forces garbage collector to run. This is not recommended but can be used ifsituations arise.

Relection
All .NET assemblies have metadata information stored about the types defined in modules. This
metadata information can be accessed by mechanism called as “Reflection”. System. Reflection
can be used to browse through the metadata information.
Using reflection, you can also dynamically invoke methods using System.Type.Invokemember.

Interoperatability and Threads



What is NameSpace?
Namespace has two basic functionality:-
• NameSpace Logically group types, example System.Web.UI logically groups UI
related features.
• In Object Oriented world, many times it is possible that programmers will use the
same class name. Qualifying NameSpace with class name can avoid this collision.
If you want to view an Assembly how do you go about it?
Twist: What is ILDASM?
When it comes to understanding of internals, nothing can beat ILDASM. ILDASM converts the
whole ‘exe’ or ‘dll’ in to IL code. To run ILDASM you have to go to ‘C:\Program
Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin’. Note that we had v1.1 you have to
probably change it depending on the type of framework version you have.
If you run IDASM.EXE from the path you will be popped with the IDASM exe program as
shown in figure ILDASM. Click on file and browse to the respective directory for the DLL whose
assembly you want to view. After you select the DLL you will be popped with a tree view details
of the DLL as shown in figure ILDASM. On double clicking on manifest, you will be able to
view details of assembly, internal IL code etc as shown in Figure Abvoe ‘Manifest View’.
What is Manifest?
Assembly metadata is stored in Manifest. Manifest contains all the metadata needed to do the
following things (See Figure Manifest View for more details):
• Version of assembly.
• Security identity.
• Scope of the assembly.
• Resolve references to resources and classes.
The assembly manifest can be stored in a PE file either (an .exe or) .dll with Microsoft
intermediate language (MSIL code with Microsoft intermediate language (MSIL) code or in a
stand-alone PE file, that contains only assembly manifest information.
What is GAC?
Twist: In what situations will you register .NET assembly in GAC?
GAC (Global Assembly Cache) is where all shared .NET assembly reside. GAC is used in the
following situations:-
• If the application has to be shared among several application.
• If the assembly has some special security, requirements like only administrators can
remove the assembly. If the assembly is private then a simple delete of assembly
the assembly file will remove the assembly.

What is COM?
Microsoft’s COM is a technology for component software development. It is a binary standard,
which is language independent. DCOM is a distributed extension of COM.
What is Reference counting in COM?
Reference counting is a memory management technique used to count how many times an object
has a pointer referring to it. The first time it is created, the reference count is set to one. When the
last reference to the object is nulled, the reference count is set to zero and the object is deleted.
Care must be exercised to prevent a context switch from changing the reference count at the time
of deletion. In the methods that follow, the syntax is shortened to keep the scope of the discussion
brief and manageable.
Can you describe IUKNOWN interface in short?
Every COM object supports at least one interface, the IUnknown interface. All interfaces are
classes derived from the base class IUnknown. Each interface supports methods access data and
perform operations transparently to the programmer. For example, IUnknown supports three
methods, AddRef, Release(), and QueryInterface(). Suppose that pinterf is a pointer to an
IUnknown. pinterf->AddRef() increments the reference count. pinterf->Release() decrements the
reference count, deleting the object when the reference count reaches zero. pinterf-
>QueryInterface (IDesired, pDesired) checks to see if the current interface (IUnknown) supports
another interface, IDesired, creates an instance (via a call to CoCreateInstance ()) of the object if
the reference count is zero (the object does not yet exist), and then calls pDesired->AddRef () to
increment the reference count (where pDesired is a pointer to IDesired) and returns the pointer to
the caller.
Can you explain what DCOM is?
DCOM differs from COM in that it allows for creating objects distributed across a network, a
protocol for invoking that object’s methods, and secures access to the object. DCOM provides a
wrapper around COM, hence it is a backwards compatible extension. DCOM uses Remote
Procedural Calls (RPC) using Open Software Foundation’s Distributed Computing Environment.
These RPC are implemented over TCP/IP and named pipes. The protocol, which is actually being
used, is registered just prior to use, as opposed to being registered at initialization time. The
reason for this is that if a protocol is not being used, it will not be loaded.

Types of Transactions are there in COM + .NET
5 transactions types can be used with COM+. Whenever an object is registered with COM+, it
has to abide either to these 5 transaction types.
Disabled: - There is no transaction. COM+ does not provide transaction support for this
component.
Not Supported: - Component does not support transactions. Hence even if the calling component
in the hierarchy is transaction enabled this component will not participate in the transaction.
Supported: - Components with transaction type support will be a part of the transaction. This
will be only if the calling component has an active transaction. If the calling component is not
transaction enabled this component will not start a new transaction.
Required: - Components with this attribute require a transaction i.e. either the calling should
have a transaction in place else, this component will start a new transaction.
Required New: - Components enabled with this transaction type always require a new
transaction. Components with required new transaction type instantiate a new transaction for
themselves every time.
Threading
What is Multi-tasking?
It is a feature of modern operating systems with which we can run multiple programs at same
time example Word, Excel etc.
What is Multi-threading?
Multi-threading forms subset of Multi-tasking. Instead of having to switch between programs,
this feature switches between different parts of the same program. Example you are writing in
word and at the same time word is doing a spell check in background.
What is a Thread?
A thread is the basic unit to which the operating system allocates processor time.
Did VB6 support multi-threading?
While VB6 supports multiple single-threaded apartments, it does not support a free-threading
model, which allows multiple threads to run against the same set of data.
we have multiple threads in one App domain?
One or more threads run in an AppDomain. An AppDomain is a runtime representation of a
logical process within a physical process. Each AppDomain is started with a single thread, but
can create additional threads from any of its threads.

.NET Basics


We just thought we should first start with the most asked question, differences between all
framework versions. Below figure '.NET growth' shows how the framework has evolved. In .NET
1.1 we had the basic framework, web services, CLR, ADO etc...NET 2.0 paid more attention on
increasing the productivity of the developer. They had modules like MARS, Generics, Partial
classes, DPAPI etc...NET 3.0 was more about fulfilling the SOA dreams. They had modules like
WCF, WPF and WWF. We have complete chapter on 3.0 please read it to understand the
fundamentals..NET 3.5 has new query capabilities like LINQ, AJAX which is now an integral
part of 3.5 setup and new protocol support for WS-* specifications

What is an IL?
Twist: - What is MSIL or CIL, What is JIT?
(IL)Intermediate Language is also known as MSIL (Microsoft Intermediate Language) or CIL
(Common Intermediate Language). All .NET source code is compiled to IL. IL is then converted
to machine code at the point where the software is installed, or at run-time by a Just-In-Time
(JIT) compiler.
What is a CLR?
Full form of CLR is Common Language Runtime and it forms the heart of the .NET framework.
All Languages have runtime and it is the responsibility of the runtime to take care of the code
execution of the program. For example, VC++ has MSCRT40.DLL, VB6 has MSVBVM60.DLL,
and Java has Java Virtual Machine etc. Similarly, .NET has CLR. Following are the
responsibilities of CLR
Garbage Collection: - CLR automatically manages memory thus eliminating
memory leaks. When objects are not referred, GC automatically releases those
memories thus providing efficient memory management.
Code Access Security: - CAS grants rights to program depending on the security
configuration of the machine. Example the program has rights to edit or create a
new file but the security configuration of machine does not allow the program to
delete a file. CAS will take care that the code runs under the environment of
machines security configuration.
Code Verification: - This ensures proper code execution and type safety while the
code runs. It prevents the source code to perform illegal operation such as accessing
invalid memory locations etc.

What is CTS?
In order that two language communicate smoothly CLR has CTS (Common Type
System).Example in VB you have “Integer” and in C++ you have “long” these datatypes are not
compatible so the interfacing between them is very complicated. In order that these two different
languages communicate Microsoft introduced Common Type System. So “Integer” data type in
VB6 and “int” data type in C++ will convert it to System.int32, which is data type of CTS. CLS,
which is covered in the coming question, is subset of CTS.
What is a CLS (Common Language Specification)?
This is a subset of the CTS, which all .NET languages are expected to support. It was always a
dream of Microsoft to unite all different languages in to one umbrella and CLS is one-step
towards that. Microsoft has defined CLS, which are nothing but guidelines, that language should
follow so that it can communicate with other .NET languages in a seamless manner.
What is a Managed Code?
Managed code runs inside the environment of CLR i.e. .NET runtime. In short, all IL are
managed code. However, if you are using some third party software example VB6 or VC++
component they are unmanaged code, as .NET runtime (CLR) does not have control over the
source code execution of these languages.
What is a Assembly?
• Assembly is unit of deployment like EXE or a DLL.
• An assembly consists of one or more files (dlls, exe’s, html files etc.), and
represents a group of resources, type definitions, and implementations of those
types. An assembly may also contain references to other assemblies. These
resources, types and references are described in a block of data called a manifest.
The manifest is part of the assembly, thus making the assembly self-describing.
• An assembly is completely self-describing. An assembly contains metadata
information, which is used by the CLR for everything from type checking an
security to actually invoking the components methods. As all information is in
the assembly itself, it is independent of registry. This is the basic advantage as
compared to COM where the version was stored in registry.
• Multiple versions can be deployed side by side in different folders. These different
versions can execute at the same time without interfering with each other.
Assemblies can be private or shared. For private assembly deployment, the
assembly is copied to the same directory as the client program that references it. No
registration is needed, and no fancy installation program is required. When thecomponent is removed, no registry cleanup is needed, and no uninstall program is
required. Just delete it from the hard drive.
• In shared assembly deployment, an assembly is installed in the Global Assembly
Cache (or GAC). The GAC contains shared assemblies that are globally accessible
to all .NET applications on the machine.