Ads Header

ssdf

sssssadf asdf asdfsad fasd dfasdf

Is there a way to force garbage collection?

Yes. Set all references to null and then call System.GC.Collect(). If you need to have some objects destructed, and System.GC.Collect() doesn’t seem to be doing it for you, you can force finalizers to be run by setting all the references to the object to null and then calling System.GC.RunFinalizers().
Read more...

Is there any sample C# code for simple threading?

using System;
using System.Threading;
class ThreadTest
{
public void runme()
{
Console.WriteLine("Runme Called");
}
public static void Main(String[] args)
{
ThreadTest b = new ThreadTest();
Thread t = new Thread(new ThreadStart(b.runme));
t.Start();
}
}
Read more...

what are the differences between Datalist DataGrid and datarepeater ?

DataList*Has table appearence by default*Has no autoformat option*has no default paging & sorting options*can define separators between elements using template

DataGrid*Has a grid appearence by default*has a autoformat option*has default paging and sorting*has no separator between elements

DataRepeater
simple,read-only output, has no built in support for selecting or editing items, has no DEFAULT APPEARENCE,has no default paging.
Read more...

what is the purpose of “base” keyword in c# ?

1) used to access a base class constructor

2) used to access a base class member in the derived class.

Read more...

what is the difference between ref and out parameters ?

ref –> inout

out –> Out

Argument passed as ref must be initialized before it is passed to the method,where as incase of Out it’s not neccssary.but after a call to the method as an out parameter the variable must be initialized .out parameter can be used when you want to return more than one value from a method.

Read more...

Describe the difference between inline and code behind - which is best in a loosely coupled solution?

Inline Versus Code-Behind Programming ModelsASP.NET supports two modes of page development:Page logic code that is written inside blocks within an .aspx file and dynamically compiled the first time the page is requested on the server.Page logic code that is written within an external class that is compiled prior to deployment on a server and linked “behind” the .aspx file at run time.
Read more...

Diffrence between Sever.transfer and respone.redirect

Server.Transfer() : client is shown as it is on the requesting page only, but the all the content is of the requested page. Data can be persist accros the pages using Context.Item collection, which is one of the best way to transfer data from one page to another keeping the page state alive.

Response.Dedirect() :client know the physical loation (page name and query string as well). Context.Items loses the persisitance when nevigate to destination page
Read more...

Explain the differences between Server-side and Client-side code?

ASP is a “server side scripting” which is used in a web pages like e-commerce, database, guest book, etc. Server side scripting means that all the script will be executed by the server and interpreted as needed.ASP doesn’t have some of the functionality like sockets, uploading, etc. For these you have to make a custom components usually in VB or VC++.
Client side scripting means that the script will be executed immediately in the browser such as form field validation, clock, email validation, etc. Client side scripting is usually done in VBScript or JavaScript.
VBScript , JavaScript ???
VBScript is the client side scripting (script which is executed in your browser). This script looks like VB and it is only supported by Internet Explorer.JavaScript is also another client side scripting based on Java. This script is supported by Internet Explorer and also Netscape browser
Read more...

what is difference between .dll & .exe?

ACTIVEX DLL:
An in-process component, or ActiveX DLL, runs in another application’s process.In-process components are used by applications or other in-process components. this allows you to wrap up common functionality (like an ActiveX Exe).

ACTIVEX EXE:
An out-of-process component, or ActiveX EXE, runs in its own address space. The client is usually an application running in another process.The code running in an ActiveX Exe is running in a separate process space. You would usually use this in N-Tier programming. An ActiveX EXE runs out of process while an ActiveX DLL runs in the same process space as VB app. Also, and ActiveX EXE can be run independent of your application if desired.

Read more...

What is the difference between boxing and unboxing???

A: Boxing allows us to convert value types to reference types. Basically, the runtime creates a temporary reference-type box for the object on heap.Eg:int i=20;object o=i;
Read more...

Describe garbage collection (in simple terms).

Garbage collection eliminates uneeded objects.1. the new statement allocates memory for an object on the heap.2. When no objects reference the object it may be removed from the heap (this is a non deterministic process).3. Finalize is called just before the memory is released.
Read more...

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

SOAP is not the transport protocol. SOAP is the data encapsulation protocol that is used but the transport protocol is fairly unlimited. Generally HTTP is the most common transport protocol used though you could conceivanly use things like SMTP or any others. SOAP is not dependant on any single transport protocol or OS, it is a syntactical and logical definition, not a transport protocol.
Read more...

Whats an assembly?

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

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

a == b is used to compare the references of two objects
a.Equals(b) is used to compare two objects
Read more...

difference between thread and process?

Thread - is used to execute more than one program at a time.
process - executes single program
Read more...

What does connection string consist of?

Connection String for .Net & SQL Server consist of:
1.Data Source = “./SQLEXPRESS”; serverName\instanceName as Data Source to use a specific SQL Server instance
2.Initial Catalog = “DATABASE_NAME”;
Either3.Uid=”UserID for SQL server” ;4.Password= “Password for SQL server”;ORIntegrated Security=”True”; Use Windows security
5.Provider Name =”System.Data.SqlClient”;
Read more...

What are the 2 types of polymorphism supports in .NET?

1. Polymorphism via Inheritance
2. Polymorphism via Interfaces
Read more...

What are interface in .NET?

Interface similar to class But it contains abstract methods only.It supports Multiple interface instead of multiple inheritance.It does’t support accessibility modifiers. Hence it is not implemented. It is implemented by class.
Read more...

What are indexes .NET?

Indexes are set up as a subset of data from the column it is created in an index table and a set of pointers to the physical table itself. The index tables are updated when data is inserted, updated or deleted. This can actually have negative performance impact if indexes are unnecessarily created. The overuse of indexes can become as much as burden to the application as not having indexes.
Read more...

What is isPostback property?

Is postback is a property of page to check weather the page is loaded first time or in response to the client callback.
Read more...

What diff b/w overloading and overriding? How can this be .net

Overriding : derived classes follow the same base class method signatures.
Overloading : Derived classes may have different method signature with different parameters.
Read more...

About a class access specifiers and method access specifiers

1) Public : available throughout application.2) Private : available for class and its inherited class.3) Protected : restricted to that class only.4) Internal : available throughout that assembly.
Read more...

ASP.NET OBJECTS?

Request, Response, Server, Session, application,
Read more...

Explain the life cycle of an ASP .NET page.

In ASP.NET2.0 page life cycle events are fired by the following sequence.
1.PreInit, 2.Init, 3.InitComplete, 4.PreLoad, 5.Load, 6.Control events, 7.LoadComplete, 8.PreRender, 9. SaveStateComplete, 10. Render, 11.Unload
Read more...

Differences between application and session

The session object maintains state on a per client basis whereas the application object is on a per application basis and is consistent across all client requests.
Read more...

Describe the techniques for optimising your application?

. Avoid round-trips to server. Perform validation on client.

. Save viewstate only when necessary.

. Employ caching.

. Leave buffering on unless there is a dire need to disable it.

. Use connection pooling.

. Use stored procedures instead of in-line SQL or dynamic SQL.

Read more...

What are the collection classes?

Queue, Stack, BitArray, HashTable, LinkedList, ArrayList, NameValueCollection, Array, SortedList , HybridDictionary, ListDictionary, StringCollection, StringDictionary
Read more...

What are object-oriented concepts?

Class: The formal definition of an object. The class acts as the template from which an instance of an object is created at run time. The class defines the properties of the object and the methods used to control the object’s behaviour.
Object: An object is an instance of a class.
Encapsulation: hides detailed internal specification of an object, and publishes only its external interfaces. Thus, users of an object only need to adhere to these interfaces. By encapsulation, the internal data and methods of an object can be changed without changing the way of how to use the object.
Inheritance: A class that derives from another class - known as the base class - inherits the same methods and properties. This promotes reuse and maintainability.
Abstraction: the describing of objects by defining their unique and relevant characteristics (properties). Whilst an object may have 100s of properties normally only those properties of importance to the situation are described. (eg life policies premiums are normally important; whereas the time of day a policy was purchased is not usually of value).
Polymorphism: Allows objects to be represented in multiple forms. Even though classes are derived or inherited from the same parent class, each derived class will have its own behavior. (Overriding and hiding methods)
Read more...

Explain the life cycle of an ASP .NET page.

Stage Events/Method
Page Initialization Page_Init
View State Loading LoadViewState
Postback data processin LoadPostData
Page Loading Page_LoadPostBack Change Notification RaisePostDataChangedEvent
PostBack Event Handling Raise
PostBackEventPage
Pre Rendering Phase Page_PreRender
View State Saving SaveViewState
Page Rendering Page_RenderPage
Unloading Page_UnLoad
Read more...

ssss

sssssadf asdf asdfsad fasdf asdfasdf