My Thoughts & Views

Archive for the ‘dotnet’ Category

My last Saturday & Sunday was filled with full of excitement, as I spent my time at Tech.Ed, organised by & BITPro Communities, listening to their wonderful sessions. It was sponsered by Infragistics, telerik,ineta & Microsoft UGSS. It was really a wonderful experience.The main reason for me to attend this event was to know about Virtualization, Cloud Computing but this event helped me to understand the technologies, which I could never have known.

I met some of the wonderful people, got to know lots of upcoming new technologies & had lots of dreams about the various skillsets that I can include in my resume :).

Day 1: (20 June 2009)

The session started with a Keynote by Mr.Ramkumar. His session was interesting start for the other sessions, as the keynote walked us through the various technologies like, Virtualization, Cloud Computing, SaaS, SOA,EAI & reducing the carbon foot print.

Next session was really interesting & inspiring, got to learn about latest features of Windows 7 by Vijay & Vic , Location & Sensor demo’s were really interesting.This session was very informative and was excited to know a product from MS with such nice features.

Then we had a session on ASP.NET 4.0 by Chaitra, which was helpful (BTW,I am ASP.NET Web Apps Developer & It was something i was looking for) as it gave me an insight into the upcoming features. Waiting to use it for any of the projects.

Then the next session was on Solving Integration Challenges with BizTalk by Kashi, I knew the name “BizTalk” but didn’t know how it will be used in Enterprises, & this session really gave me an insight into the world of BizTalk.

After Lunch, we had session on Biztalk & WCF by Meena,this session even further increased my curiosity, I worked on a project on WCF & this particular session made me to understand BizTalk better by means of WCF.

And after Biztalk & WCF session, the next one was by Vic on Silverlight 3. I liked this technology & have plans to work on a project which I was thinking for some time & was waiting for some Ideas, & this session provided me with many more options.

After all these technical sessions came the Management session by Sanath, initially I had plans to skip this session, but stayed there on my friends request, I am thankful to him. I liked the session & this was the inspiring session. After reaching home first thing I did was to find the videos shown in this session on youtube.

Day 2: (21 June 2009)

The day started with Keynote by Vic, he talked about Infragistics & showed demo of their wonderful Controls.

The Next session was on Micosoft Azure by Janakiram, I had very little idea about it, but this session clarified most of the things which I didn’t know about.

After the Azure session came the Work Flow Foundation by Gayathri, which I missed to attend, so I can’t give much details about it, but my friend said it was good.

Before lunch we had a session on SQL Server 2008 & Unstructured data by Praveen, this session helped me to know how microsoft is handling the unstructured data. It usually happens in real world that, most of the time we deal with unstructured data, & I was interested to know much about it & this session helped me to know the ways to deal with unstructured data.

After Lunch, the next session was on Microsoft Echange Server 2010, this session was good, but after some time I was feeling drowsy, as I had rice more during lunch, so lost most part of the session.

The next session was on Windows Server 2008 R2 by S.Kaliyan, which was interesting to know. I listned to this with much attention as it was the base for Microsoft Azrue Platform & at the end of the day we got Trial version of Windows Server 2008 R2 DVD.

The last session of the event was on Virtualization 360 by Praveen, this also was my favourite topic as I experimented with Virtualization my self without going through much details. I used Microsoft Virtual PC 2007 to run Knoppix Live Linux. I came to know the types of virtualizations & many interesting things.

Overall I liked the whole Tech.Ed, it really helped me to get started on many technologies.

BTW, I couldn’t take much pictures at the event as I was busy taking notes, but here is the photo with all the people who conducted the wonderful 2 day event.

If any of you have attended it then let me know about your thoughts & views.

1. Add wnvhtmlconvert.dll to Project Reference under Visual Studio

2. Import it into your code behind file “using Winnovative.WnvHtmlConvert;”

3. Add your PdfConverterKey into Web.Config

<add key=”PdfConverterKey” value=”your key here”/>

4. Write Below Code (Click to Expand)

And you are done.
Let me know if you have any questions

Suppose you have two interfaces, lets say Interface-IA, Interface-IB & in both you have declared Name as a property as follows.

public interface IA

string Name { get; set; }
String Adress { get; set; }


public interface IB

string Name { get; set; }


Now, you write an interface -IC which derives from above 2 Interfaces as below,

public interface IA

int Id { get; set; }


When you are try to do the following, you will get an error saying ‘Ambiguity between IA.Name and IB.Name’.

class Test

public void GetSomething()
IC objIc = new IC();
Textbox1.Text = objIc.Name();


It can be solved by upcasting as below.

class Test

public void GetSomething()
IC objIc = new IC();
Textbox1.Text = ((IA)objIc).Name();


If NLog Intellisense is not working in Visual Studio then copy NLog.xsd into following location
Visual Studio 2008
C:\Program Files\Microsoft Visual Studio 9.0\Xml\Schemas
Visual Studio 2005
C:\Program Files\Microsoft Visual Studio 8\Xml\Schemas
1. Open Visual Studio
2. Go to Tools > Options
3. Check Show all setting check box
4. Select Projects and Solutions from the tree
5. Check “Always Show solution” checkbox

6. Click Ok
7. Now Select Create New Project
8. From tree List select Other Project Types
9. Then Visual Studi Soultions, You will see Blank Solution in Templates section.

Advantages of Self-Hosting:

  • Is easy to use: With only a few lines of code you have your service running.
  • Is flexible: You can easily control the lifetime of your services through the Open() and Close() methods of ServiceHost.
  • Is easy to debug: Debugging WCF services that are hosted in a self-hosted environment provides a familiar way of debugging, without having to attach to separate applications that activate your service.
  • Is easy to deploy: In general, deploying simple Windows applications is as easy as xcopy. You don’t need any complex deployment scenarios on server farms, and the like, to deploy a simple Windows application that serves as a WCF ServiceHost.
  • Supports all bindings and transports: Self-hosting doesn’t limit you to out-of-the-box bindings and transports whatsoever. On Windows XP and Windows Server 2003, IIS limits you to HTTP only.


Disadvantages of Self-Hosting:

  • Limited availability: The service is reachable only when the application is running.
  • Limited features: Self-hosted applications have limited support for high availability, easy manageability, robustness, recoverability, versioning, and deployment scenarios. These scenarios have become a standard in last few years. Such features are provided by the WAS (Windows Activation Service) which is a part of IIS7 (delivered with Vista and Win2008). This hosting mechanism allows you to host the service by using of protocols like MSMQ, HTTP and TCP. 

Recently after deploying our application, our modifications were not showing up then we rebuilt the solution and it worked, till that time i did not break my head understanding what Build & Rebuild was. Here is what i found out.

Build means compile and link only the source files that have changed since the last build, while Rebuild means compile and link all source files regardless of whether they changed or not. Build is the normal thing to do and is faster. Sometimes the versions of project target components can get out of sync and rebuild is necessary to make the build successful. In practice, you never need to Clean.

Build or Rebuild Solution builds or rebuilds all projects in the your solution, while Build or Rebuild builds or rebuilds the StartUp project, “hello” in the screen shot above. To set the StartUp project, right click on the desired project name in the Solution Explorer tab and select Set as StartUp project. The project name now appears in bold. Since the homework solutions typically have only one project, Build or Rebuild Solution is effectively the same as Build or Rebuild .

Compile just compiles the source file currently being edited. Useful to quickly check for errors when the rest of your source files are in an incomplete state that would prevent a successful build of the entire project. Ctrl-F7 is the shortcut key for Compile.

  • Both are XML files
  • *.xml Files can be rendered on browser i.e, if u know the path of XML you can access it and see the contents on Browser.
  • *.config file can’t be rendered on browser i.e, even if u know the path of XML(*.config) file you can’t access it and see the contents on Browser so it is secured.

Thanks to my TL Jeebu.

Following are the tutorials i hope are good to learn ASP.NET.


Will keep posting such useful stuff whenever i find.

The DateTime class is not very exact and only can measure in milliseconds. When doing performance measuring on an application you most certainly need to be able to measure with smaller time units than that. High-resolution timers are supported in the Win32 API so following code wraps it up in a simple class:

public class PerformanceTimer
public static extern void QueryPerformanceCounter(ref long ticks);

long startTime = 0;
long stopTime = 0;

public void Start()
QueryPerformanceCounter(ref startTime);

public void Stop()
QueryPerformanceCounter(ref stopTime);

public long Time
return stopTime – startTime;

I’m sure the code is easy to understand. Here is the sample code to show how to use it.

PerformanceTimer perfoTimer = new PerformanceTimer();

// Do something


Problem : Calculate the sum of a column in a dataset

Solution :
After filling the dataset from your query you can calculate the sum of a numeric column.

Dataset’s DataTable provides a default method called Compute through which you can perform any aggregate function based operation on columns in a DataTable.

Suppose you have

1. Column : Salary
2. DataSet : dsData
3. DataTable Name : Payroll


dsData.Tables(“Payroll”).Compute(“SUM(Salary)”, String.Empty)

Gives the sum of that column.

Compute accepts two arguments : 1. Expression (Any aggregate Expression)
2. Filter (Any Filtering option, here String.Empty means no filter value)

This is second in series of Interview Questions for .NET Application developer position.


* Does C# supports multiple inheritence?
* What is a delegate?
* What are setallite assemblies?
* Differences between Namespace, Class, Assembly?
* What is the difference between managed and unmanaged code?
* What is serialization?
* What’s a bubbled event?
* What is garbage collection? How dot net handles the garbage collection?
* Can we force garbage collector to run ?
* What is concept of Boxing and Unboxing ? Do we have the same problem in c# 2.0? if no how it is resolved? What are generics?
* What happens in memory when you Box and Unbox a value-type?
* What are the ways to deploy an assembly?
* What is the difference between the value type and reference type? Do we have value type in dot net?
* What different types of JIT compliler do we have?
* What’s a multicast delegate?

C# 2.0

* What are the partial classes? Where we can use them?
* Any idea of LINQ project?
* What are generics?

C# Distributed Application

* What different option do we have for creating distributed applications in dot net?
* What is a thread? What is multithreading?
* What is deadlock? How we can elimate the risk?
* This data structure is “Thread Safe” what does that mean?
* What are locks and why we need them? When working with shared data in threading how do you implement synchronization ?
* What are sockets? What is the difference between TCP and UDP sockets?
* Any idea of Windows Communication Foundation?
* What is the difference between a thread and a process? Can a process have multiple threads?
* How we can communicate betweem two processes?
* What is the procedure of communicating between two threads?
* What’s Thread.Join() in threading ?
* What are the different states of a thread?

Following are the ASP.NET interview questions usually asked for experienced people.

* What is View State? Can you read the View State?

— It is ASP.NET State Management Technique to persist changes to the state of a Web Form across post backs. It stores the data in the form of Dictionary (i.e., in Key /Value Pair).

–The Control.ViewState property is associated with each server control in your web form and provides a dictionary object for retaining values between such multiple requests for the same page.

–This is the method that the page uses to preserve page and control property values between round trips.

— You can use ViewState to store any object as long as it is serializable .

— Data is stored in Base 64 Encoding

–It is not encrypted by default.

— The view state of a page is, by default, placed in a hidden form field named __VIEWSTATE.

* Can we disable the view state application wide? Can we disable it on page wide?

— Yes, in web.config file add this line

* Can we disable it for a control?

Yes, set enableViewState=false for the control.

* What is Serialization ?

— Serialization is the process of storing an object’s data and other information necessary to reconstruct the object later.
* What is the difference between encoding and encryption? Which is easy to break?

Encoding –the process of converting a digitized file into a streaming format. or the activity of converting from plain text into code or is the process of transforming information from one format into another.

Encryption— is the process of transforming information (referred to as plaintext) using an algorithm (called cipher) to make it unreadable to anyone except those possessing special knowledge, usually referred to as a key.

Encoding is easy to break.

* What are the Data Access Components provided by Microsoft?

— SqlProvider , OledbProvider, odbcProcvider, oracleProvider

* Any idea of Enterprise library?

Enterprise library is a set of tools developed by Microsoft for enterprise development using .NET.

* What is web service?

— Web Service is a software system designed to support interoperable Machine to Machine interaction over a network. Web services are frequently just Web API’s that can be accessed over a network, such as the Internet, and executed on a remote system hosting the requested services.

* What is WSDL?

— Web Services Description Language.

— is an XML-based language that provides a model for describing Web services.

* Can a web service be only developed in ASP.NET?

— No.
* Can we use multiple web services from a single application?
Yes, you can use.

* Can we call a web service asynchronously?

— Yes. Web Services support both synchronous and asynchronous communication between the client application and the server hosting the service.

* Can a web service be used from a windows application?

– Yes.
* What do we need to deploy a web service?

* What is the significance of web.config?

— It is a ASP.NET Configuration file

— File format is XML so it is stored as text and it is easy to modify.

* Can we have multiple web.config files in a sigle web project?
— Yes but not in single folder.

* Type of ASP.NET Authentications?

— Windows, Forms, Passport, Custom.
* Can we have multiple assemblies in a single web project?

— Yes.
* What is GAC?

— Global Assembly Cache

—- Shared assemblies are stored here

—- You can access it in this path C:\WINNT\assembly or C:\WINDOWS\assembly
* What is machine.config?

— It is a Machine Wide ASP.NET Configuration File.

— It is stored in C:\WINNT\Microsoft.NET\Franework\[Framework Version\CONFIG or C:\windows\Microsoft.NET\Franework\[Framework Version\CONFIG

* What different types of session state Management we have in

— InProc, StateServer, SQLServer
* What are cookies?

— It is a small text file stored in Browser Cache.

—- cookies are used for authenticating, tracking, and maintaining specific information about users, such as site preferences or the contents of their electronic shopping carts.

* What is Cache?

— A web browser or web server feature which stores copies of web pages on a computer’s hard disk.

* What is AJAX?

— Asynchronous JavaScript and XML

— It is a Set of interrelated Technologies mainly consisted of xHTML, JavaScript, XML,
* Is
AJAX a language?

— No, it is a set of interrelated technologies.
* What is an Assembly?

— Single Deployable unit

— EXE or DLL.

— Unit of Execution

— is a partially compiled code library for use in deployment, versioning and security.

— It can consist of one or more files.
* Can an assembly contain more then one class?

— Yes
* What is strong name?

— A strong name consists of the assembly’s identity—its simple text name, version number, and culture information (if provided)—plus a public key.

* What is the difference b/w client and server side?

Client Side :Code is executed in Client Machine

— Server Side: Code is executed at Server Side.

* What is the purpose of IIS?

— IIS is a Web Server, which handles HTTP Requests and helps in authentication.
* Difference between http and https?

— HTTP is not secured HTTPS is secured.
* What is purpose of aspnet_wp.exe?

— aspnet_wp.exe is a ASP.NET worker process whose role is to process requests, such as processing requests to return a ASP.NET page, invoking an ISAPI extension or filter.

* What do you mean by HTTP Handler?

— They are used to handle different types of page extensions.
* What is the purpose of Global.asax?

— It is used to handle application wide events.

* What is the difference between the inline and code behind?

— inline: You can write your server side code and UI in same file.

— code behind: Contains logic of the application.

* What is side by side execution?

— You can run two versions of application simultaneously.
* Can we have two different versions of dot net frameworks running on the same machine?
— Yes.

* What is CLR?

— Common Language Runtime

— It is .NET Run time environment, which has features such as Automatic Memory Management, Garbage Collection, Versioning, Security.
* What is CLI?

— Common Language Infrastructure

— It is an open specification (published under ECMA-335 and ISO/IEC 23271) developed by Microsoft that describes the executable code and runtime environment that form the core of a number of runtimes including the Microsoft .NET Framework, Mono, and Portable.NET.
* What is CTS?

— Common Type System

— CTS cover the range of topics related to type handling. These topics include type safety, cross-language sharing of typed data, type behavior and features, and performance.

* What is .resx file meant for?

This is a Resource File.

It is an XML based file, with key value pair.

— It is used in Localization and Globalization
* Any idea of aspnet_regiis?

— It is a ASP.NET registration

* Any idea of
ASP NET State Service?

— It is an Out of Process Session State management.

— Session state is stored in separate process (i.e, aspnet_state.exe).

* What is the difference between stroed procedure and stored function in SQL?
— Both functions and stored procedures can be custom defined and part of any application. Functions, on the other hand, are designed to send their output to a query or T-SQL statement. For example, User Defined Functions (UDFs) can run an executable file from SQL SELECT or an action query, while Stored Procedures (SPROC) use EXECUTE or EXEC to run.

Stored procedures are designed to return its output to the application. A UDF returns table variables, while a SPROC can’t return a table variable although it can create a table. Another significant difference between them is that UDFs can’t change the server environment or your operating system environment, while a SPROC can. Operationally, when T-SQL encounters an error the function stops, while T-SQL will ignore an error in a SPROC and proceed to the next statement in your code (provided you’ve included error handling support).

If you have an operation such as a query with a FROM clause that requires a rowset be drawn from a table or set of tables, then a function will be your appropriate choice. However, when you want to use that same rowset in your application the better choice would be a stored procedure.

* Can we have an updateable view in SQL?

— Views in SQL Server are usually thought of as read-only select statements; however it is actually possible to build a view to be updatable as well. This allows you to modify the data in the tables the view is based on through insert, update and delete statements on the view. Normal views provide the ability to abstract the physical data model (table) into a logical data model (view); updatable views take this one step further by allowing all CRUD data access to be done though one interface (updatable view).

* What is connection pooling? how can we acheive that in
— Connection pooling behavior is controlled by the connection string parameters. The following are four parameters that control most of the connection pooling behavior:

* Connect Timeout – controls the wait period in seconds when a new connection is requested, if this timeout expires, an exception will be thrown. Default is 15 seconds.

* Max Pool Size – specifies the maximum size of your connection pool. Default is 100. Most Web sites do not use more than 40 connections under the heaviest load but it depends on how long your database operations take to complete.

* Min Pool Size – initial number of connections that will be added to the pool upon its creation. Default is zero; however, you may chose to set this to a small number such as 5 if your application needs consistent response times even after it was idle for hours. In this case the first user requests won’t have to wait for those database connections to establish.

* Pooling – controls if your connection pooling on or off. Default as you may’ve guessed is true.

* What is DataSet?

— is an in-memory cache of data retrieved from a data source,

— is a major component of the ADO.NET architecture.

* What is the difference between typed and untyped dataset?

* What is the difference bewteen accessing the data throgh the dataset and datareader?
— Data Reader is forward only, read only access method and it is faster compared to dataset.

— Dataset is a in memory representation of Database, accessing it is slower compared to dataset.

I request those who read this to send the interview questions which they feel should be included. And also request all to add good answers to the questions.

Keywords to find this page from Google: .net interview questions,.net interview multiple choice,.net experinced interview questions,c# interview questions, interview questions, session interview questions,c# . net + interview questions for experienced hand,c# generics interview question,c# interview questions box unbox,c# software developer interview questions,c# web interview,common it interview question .net,dot net interview questions

— It is slowest sorting algorithm in use
— It is considered as Most In efficient Sorting Algorithm.

How it works?

The basic idea is to compare two neighboring objects, and to swap them if they are in the wrong order. This process is repeated until it completly sorts the list. This causes larger values to “bubble” to the end of the list while smaller values “sink” towards the begining of the list.

C# Code :

// integers array to hold values
private int[] a = new int[100];

// number of elements in array
private int x;

// Bubble Sort Algorithm
public void sortArray()
int i ;
int j ;
int temp ;

for( i = (x 1); i >= 0; i)
for( j = 1; j <= i; j++ )
( a[j-1] > a[j] )
temp = a[j-1] ;
a[j-1] = a[j] ;
a[j] = temp ;

1 public sealed class SingletonClass
2 {
private SingletonClass()
5 }
7 private static SingletonClass instance = new SingletonClass();
9 public static SingletonClass Instance
10 {
11 get
if(instance == null)
15 instance = new SingletonClass();
16 return instance;
17 }
return instance;

I came across a new project by sun people called “Semplice”, which they claim as VB for the Java platform.

If it is true then the advantage of the Semplice Basic is,code from semplice will be compiled into Java classes, you get the benefit of “compile once, run everywhere”.

Good Competition for .NET Framework by microsoft.

Check these for more info

Blog Stats

  • 71,043 hits
August 2020

Top Clicks

  • None