Sunday, September 27, 2009
Tuesday, September 15, 2009
Poem
कोशिश करने वालों की हार नहीं होती।
नन्हीं चींटी जब दाना लेकर चलती है,
चढ़ती दीवारों पर, सौ बार फिसलती है।
मन का विश्वास रगों में साहस भरता है,
चढ़कर गिरना, गिरकर चढ़ना न अखरता है।
आख़िर उसकी मेहनत बेकार नहीं होती,
कोशिश करने वालों की हार नहीं होती।
डुबकियां सिंधु में गोताखोर लगाता है,
जा जा कर खाली हाथ लौटकर आता है।
मिलते नहीं सहज ही मोती गहरे पानी में,
बढ़ता दुगना उत्साह इसी हैरानी में।
मुट्ठी उसकी खाली हर बार नहीं होती,
कोशिश करने वालों की हार नहीं होती।
असफलता एक चुनौती है, स्वीकार करो,
क्या कमी रह गई, देखो और सुधार करो।
जब तक न सफल हो, नींद चैन को त्यागो तुम,
संघर्ष का मैदान छोड़ मत भागो तुम।
कुछ किये बिना ही जय जय कार नहीं होती,
कोशिश करने वालों की हार नहीं होती।
By: हरिवंशराय बच्चन
Monday, September 14, 2009
Split Column
Here is a sql query to split a single column to different multiple column.
CREATE TABLE Sample
(ID INT ,FullName VARCHAR(100))
----------------------------------------
INSERT INTO Sample(ID,FullName)VALUES (1,'Bheeshma,Nayak')
INSERT INTO Sample(ID,FullName)VALUES (2,'Himanshu,Mishra')
INSERT INTO Sample(ID,FullName)VALUES (3,'Ketan,Saxena')
-----------------------------------------
CREATE PROCEDURE Separate_Column
AS
BEGIN
CREATE TABLE #TEMP( FullName VARCHAR(100),
Fname VARCHAR(20),
Lname VARCHAR(20)
)
DECLARE @FullName AS VARCHAR(100)
DECLARE @Fname AS VARCHAR(20)
DECLARE @Lname AS VARCHAR(20)
DECLARE @RC AS INT
DECLARE @I AS INT
SET @I=1SELECT @RC=COUNT(1) FROM Sample
WHILE @I <= @RC
BEGIN
SELECT @FullName=FullName FROM Sample WHERE ID=@I
SET @Fname=LEFT(@FullName,CHARINDEX(',',@FullName)-1)
SET @Lname = RIGHT(@FullName,LEN(@FullName,CHARINDEX (',',@FullName))
INSERT INTO #TEMP VALUES(@FullName,@Fname,@Lname)
SET @I=@I+1
END
SELECT * FROM #TEMPDROP TABLE #TEMP
END
-------------------------------------------------------------
Note:-Next Post will Describe DotFuscator
-------------------------------------------------------------
Thanks & Regards
Bheeshma P. Nayak
Sunday, August 30, 2009
My Written Test @ ValueLabs
Here are some Good Questions which i faced in my written exam (Walkin).
:30 Question :60Minutes :Subjective Answers
1.In Which Page Cycle All Controls Are Fully Loaded
Page_load event guarantees that all controls are fully loaded. Controls are also accessed in Page_Init events but you will see that viewstate is not fully loaded during this event.
2.Types Of Authentication:
My Answer Was:
Passport,Windows & Forms authentication.
3.How To Load A XML Into a Dataset.My Answer:-
DataSet ds = new DataSet();
ds.ReadXml("C:\\Proof.xml");
4.Difference Between DataList ,ListviewI do not know answer of this question:
But Answer must be like this: which i found and learned from MSDN
ListView
Paging :supported
Data Grouping :supported
Provide Flexible Layout: supported
Update,Delete :supported
Insert: supported
Sorting: supported
GridView
Paging: supported
Data Grouping: Not supported
Provide Flexible Layout :Not supported
Update,Delete : supported
Insert :Not supported
Sorting :supported
DataList
Paging: Not supported
Data Grouping: supported
Provide Flexible Layout :supported
Update,Delete :Not supported
Insert: Not supported
Sorting: Not supported
Repeater
Paging: Not supported
Data Grouping: Not supported
Provide Flexible Layout: supported
Update,Delete: Not supported
Insert :Not supported
Sorting: Not supported .
5. Print The Value Of All Datatables in a Dataset.
My Answer was something like this ,but was incorrect as i came to know that Dataset
Does Not Support GetEnumerator ,so ForEach can not be implemented:
My Incorrect Answer was:
foreach (DataTable dt in ds)
{
foreach (DataRow dr in dt)
{
ListBox1.Items.Add(dr["Id"].ToString());
}
}
Now I Found the solution other than foreach Loop which is given below and working perfactly:
int a= ds.Tables.Count;
for (int i = 0; i < drc=" ds.Tables[i].Rows;">
6. It was a Basic Question of Abstract Class and Interface.
7. Create a DataTable Using DatColumn and DataRow.
DataTable myDataTable = new DataTable();
DataColumn myDataColumn;
myDataColumn = new DataColumn();
myDataColumn.DataType= Type.GetType("System.String");
myDataColumn.ColumnName = "id";
myDataTable.Columns.Add(myDataColumn);
myDataColumn = new DataColumn();
myDataColumn.DataType = Type.GetType("System.String");
myDataColumn.ColumnName = "username";
myDataTable.Columns.Add(myDataColumn);
DataRow row;
row = myDataTable.NewRow();
row["id"] = Guid.NewGuid().ToString();
row["username"] = "Bheeshma";
myDataTable.Rows.Add(row);
8.Question to write a css for a given specification.
9.Write A javascript for a confirmation.
Confirm("Are You Nuts!!!");
10. Where the Viewstate information stored and how can we encrypt it.
Stored In HTML Hidden Fields
Encryption:
<%@Page ViewStateEncryptionMode="Always" %>
or
<configuration> <system.web>
<pages ViewStateEncryptionMode="Always" /> </system.web></configuration>
ViewStateEncryptionMode.AutoIn this mode, ASP.NET will encrypt the ViewState for a page if any control on the page requests it. Note that this means all of the ViewState is encrypted, not just the ViewState for the control that requests it. A large part of the performance cost associated with encryption is in the overhead. So encrypting the whole ViewState is faster than doing separate encryption operations if more than one control makes the request.
ViewStateEncryptionMode.NeverAs you would expect, in this mode ASP.NET will not encrypt the ViewState, even if the application is set for encryption and controls on the page have requested it. If you know that no data involved in the page needs to be encrypted, then it may be safe to set the mode to Never. However, at this point it is rare for the documentation about a control to disclose what is being saved in ViewState, so you will want to be careful if there is a chance that sensitive data could be exposed.
ViewStateEncryptionMode.Always
In this mode, ASP.NET does not wait for a control in the page to request encryption. ViewState is always encrypted. When working with sensitive data, it is a good practice to utilize encryption.
11.What is Session and Application Object?
Session object store information between HTTP requests for a particular user, while application object are global across users.
12.What is operator Overloading,Explain with example.
Simple Question , Based on OOPS Concept.
13.Write a Code to execute a SP in ADO.NET
SqlConnection cn=new SqlConnection("ConnectionString");
SqlCommand cmd=new SqlCommand();
cmd.Connection=cn;
cmd.CommandType=CommandType.StoredProcedure;
cmd.CommandText="Test_SP";
cmd.Parameters.Add("@param1",SqlDbType.Int);
cmd.Parameters["@param1"].Value=10;
cmd.Parameters.Add("@param2",SqlDbType.Int);
cmd.Parameters["@param2"].Value=20;
cmd.Parameters.Add("@param3",SqlDbType.Int);
cmd.Parameters["@param3"].Direction=ParameterDirection.Output;
cn.Open();
cmd.ExecuteNonQuery();
cn.Close();
int x=Convert.ToInt32(cmd.Parameters["@param3"].Value);
whereas SP for the above code goes like this:-
Create proc Test_SP
@param1 int,
@param2 int,
@param3 int output
as
set @param3=@param1+@param2
14.Which is safe: Convert.ToString() or .ToString()
Ans is Convert.ToString()
The basic difference between them is "Convert" function handles NULLS while ".ToString()" does not ,it will throw a NULL reference exception error.
15.What are Value Type and reference type.
16.Can we Use custom types in webservices?
YES
It is possible to process user-defined types (also known as custom types) in a Web service. These types can be passed to or returned from Web methods. Web service clients also can use these user-defined types, because the proxy class created for the client contains these type definitions. Custom types that are sent to or from a Web service are serialized, enabling them to be passed in XML format. This process is referred to as XML serialization. Classes that are used to specify Web method return types and parameter types must provide a public default or parameterless constructor. Properties and instance variables that should be serialized in XML format must be declared public. Properties that should be serialized must provide both get and set accessors. Read-only properties are not serialized. Data that is not serialized simply receives its default value when an object of the class is deserialized.
17.What Is the Use of System.Diagnostic.Process?
Follow the given link:
http://www.dotnetspider.com/resources/31435-Use-System-Diagnostics-Process.aspx
18.Static Properties?
19.Types Of Array?
Single,Multi Dimension,Jagged
20.Difference betwenn StringBuilder and String Class.
System.String is immutable; System.StringBuilder can have mutable string where a variety of operations can be performed,and System.StringBuilder class allows us to format the string and compared to string , operation on Builder are very fast.
21.Is It Correct cType(123.34,Integer) ?
22.What is Valid XML Document.?
A valid XML document is defined by the W3C as a well-formed XML document which also conforms to the rules of a Document Type Definition (DTD) or an XML Schema (XSD), which W3C supports as an alternate to DTD.This term should not be confused with a well-formed XML document, which is defined as an XML document that has correct XML syntex according to W3C standards.
23.How To End A Session?
Session.Abondon()
24.Under Which Account ASP.NET Worker Process Runs.
ASPNET
25.Write a sample code to call a method of a web service.
26.Difference betwenn char,varchar,nvarchar?
--nchar and nvarchar can store Unicode characters.
--char and varchar cannot store Unicode characters.
--char and nchar are fixed-length which will reserve storage space for number of characters you specify even if you don't use up all that space.
--varchar and nvarchar are variable-length which will only use up spaces for the characters you store. It will not reserve storage like char or nchar.
--nchar and nvarchar will take up twice as much storage space, so it may be wise to use them only if you need Unicode support.
27.Write a SP to Get the Duplicate rows from a table.
Please Follow my Post in the same blog "Removing Duplicate Rows".
These are the Questions which i am able to recall as i have very good Memory!!!
Some Question are still unanswered..If possible then provide the solutions (m also looking for).
Need Comments and Feedback to improve this post.............
Thanks & Regards
Bheeshma P. Nayak
Sunday, August 23, 2009
C# User Define DataTypes
1.Enumeration:-
Defining:-
enum TrafficLight
{
Red,
Green,
Yellow
};
Declaration:-
TrafficLight tl;
Assigning:-
tl = TrafficLight.Yellow Or
tl =(TrafficLight) 2;
By default they begin with value 0 associated. while we can set this bound value explicitly.
---------------------------------------------------------------------------------------
2.Class
Access Modifier:-They enforce encapsulation concept of OOP.
------------------
Constant Vs. ReadOnly Fields:-
Constant are constant throughout the application and their value must be known at the time of compilation , and can not be alter during lifetime of the project.They act like a static field.
While ReadOnly field can be assigned at the the time time of declaration or in constructor , so they will be assigned at the execution time, then their value can not be alter thereafter.They are class level variable.
Ex:-
const int a=10;
readonly a = 10;
--------------------------------------------------------------------------------------
Static class
They Do not have constructor(Other than static).
So Their object can not be created.
They are sealed , hence no Inheritance mechanism take place;
Static class indicate that their member are also static.
-------------------------------------------------------------------------------------
Variable:-
local variable can not be define as public , protected,or private.
-------------------------------------------------------------------------------------
Indexer:-
-They allow us to use a class as a virtual array and enables object to be accessed by using index;
Access Modifier:- Can be Private,Public,Protected,Internal
Return type:-Any C# Valid type;
Arguments:-Must have at least one parameter,they may have multiple parameter of different type;
-All indexers in the same class must have different signatures;
-Get,set are known as accessor ,their visibility is same as the visibility of indexer by default.the accessibility of set can be set explicitly.
-operator [] is used to access indexer.
-They can be inherit.
-They can be override.
-Can be abstract(with no code in set,get)
-Can NOT be static.
---------------------------------------------------------------------------------
Interface:
-Object Can Not be created;
ex:-
public interface IMyFirst
{
void PrintMe():
}
public interface IMySecond
{
void PrintMe():
}
class Program : IMyFirst, IMySecond
{
void IMyFirst.PrintMe()
{
Console.WriteLine("Channel Next");
}
void IMySecond.PrintMe()
{
Console.WriteLine("Book Next");
}
static void Main(string[] args)
{
Program obj= new Program();
((IMyFirst)obj).PrintMe();
((IMySecond)obj).PrintMe();
}
}
- The example demonstrate how we can differentiate b/w the same method in different interface.
----------------------------------------------------------------------------------
Thanks & Regards
Bheeshma P. Nayak
C#2005 DataType
C# Datatype:-
We can say three types of Datatype in C#: Value type,Reference type,pointer type
1.Value type uses stack,and have discrete values stores in it; It does not implement data hiding features;
2.Reference type:stored in heap , .Net framework support two reference types which are Object and String;Object is the base type for Value type and reference type;
They implement data hiding concept, and their data can be manipulated by using methods;
3.Pointer type: they are not type safe, they are not controlled by G.C. while reference type are in control of GC;
Arithematic operation can be performed on Pointer type while it is not possible on reference type;
------------------------------------------------------------------------
All variables (Value type and reference type) are the class variable first.
so they can be used as an object anywhere in the system;
------------------------------------------------------------------------
Nullable Types
C# supports nullable types. nullable is a struct which has two public members.
One is Hasvalue() which return true or false.and other one is value which returns the value only if HasValue() is true , else while accessing the value property it throw an exception;
They can be used as follows:-
System.Nullable
or
int? a=10; or int? a=null;
while We can not write int a=null;, this will give an error that a is not nullable type.
--> They can be used with Value type only not with reference type;
------------------------------------------------------------------------------
SOme Note POints:-
structure elements are protected by default while class members are private by default in C#;
Structure can contain constructor,destructor,methods,properties .
structure element can not be initialized by any given value in structure.while class variable initialized by default values.
C# Class always created in heap while structure can be created in Heap or stack.
----------
Datatype.MaxValue amd Datatype.MinValue can be used to determine the range of the datatype. while these thing can not be implemented in some Datatype like bool;
----------
------------------------------------------------------------------------------
Boxing:-
It is a concept of converting a value type into Reference type.
It is a expensive process, it uses some process cycle to do so
and data reside at two place and may have contradictory state at the same time.
------------------------------------------------------------------------------
C# Supports Jagged arrays(Different rows can have different number of column )
------------------------------------------------------------------------------
This is what i studied today.........
Feedback and comments are required to improve....................
Thanks & Regards
Bheeshma P. Nayak
Friday, August 21, 2009
User Control Vs. Custom Control
A. What is user control?
B. What is custom control?
C. What are the basic differences between them?
------------------------------------------------------------------------------------------------
A.What is user control?
User controls are reusable controls, and they use the same technique which is used by HTML and Web server controls.
They offer an easy way to partition and reuse common user interfaces across ASP.NET Web applications.
How to create a user control(10 Easy Steps: From Creation to Implementing)
The process for creating a user control is almost same to the process of creating a Web Form.
The difference is: user control does not include the "html, body, and form" tag elements
Example: Create a User Control
1.Start a web application, add a simple webform, in this form we will implement Our User Control.
2.Now Add a New Item from solution Explorer.
3.Add a Web User Control in your application, this will have .ascx extension.
4.Now the design page will be in front of you, so here you can put whatever u want in ur User control. I did it like this in design page:-
<P>
<asp: Label id="lblName" runat="server">Enter Name Here</asp: Label>
<asp: Textbox id="txtName" runat="server"></asp: Textbox>
</P>
<P>
<asp: Label id="lblPass" runat="server">Enter Password</asp: Label>
<asp: Textbox id="txtPass" runat="server" Text Mode="Password"></asp: Textbox>
</P>
<P>
<asp: Button id="btnDisplay" runat="server" Text="Display"></asp: Button>
</P>
<P>
<asp: Label id="lblOutput" runat="server"></asp: Label>
</P>
5. The above code provides a user to enter his name and password, and user can click on Display button to see what data is entered by him/her.
6. On the button Click event I wrote the following code
Private void btnDisplay_Click (object sender, System.EventArgs e)
{
lblOutput.Text=
"User Name:-"+txtName.Text+"\n"+"Password:-"+txtPass.Text;
}
7. Compile and save the application. (Hope there should be no Error)
8. Now come back to our webform which we added at the beginning of our application.
9. Open solution explorer, u can find our Usercontrol with .ascx extension will be present and waiting for something to happen, drag and drop it onto the webform.
(This drag and drop process will automatically put following code in design form (HTML) for registering that User Control)
Ex :-( Near Page Directive)
<%@ Register TagPrefix="uc1" TagName="WebUserControl1" Src="WebUserControl1.ascx" %>
AND (In the Form Tag)
"<uc1:WebUserControl1 id="WebUserControl11" runat="server"></uc1:WebUserControl1>"
10. Run the application and Enjoy………….
User control processing IN Depth:-
What happens when a page with a user control is requested?
Answer is right here:-
· The page parser parses the .ascx file (it Gets the file from @Register Directive)and generates a class that derives from the System.Web.UI.UserControl class. And compile the class dynamically. But Actually most of us visual studio for all this stuff so at the design time a code behind file for the user control is created and precompiled by the designer. That means finally at runtime it have all the code i.e. the generated one + what we wrote in .ascx.cs file.
B.What is custom control?
They are compiled code components that execute on the server, and render markup text, such as HTML or XML, as a normal Web Form or user control does.
How to create a Custom control(10 Easy Steps: From Creation to Implementing)
1. Start a Console application(Default Name will be ConsoleLibrary1), automatically there will be default class Called Class1 is created.
2. Add a reference to your application called Syatem.Web.
3. Choosing A Base Class:
To Create a custom control first we need to choose a base class which may be System.Web.UI.Control if we want to render nonvisual elements. OR we can choose System.Web.UI.WebControls.WebControl if we want the control to render HTML that generates a visual interface.And if we need to extend the functionality of an existing control like TextBox ,Button,GridView, then we drive our class from the existing class for the controls and overdide the behaviour .
4. Derive your class (Class1) by your choosen class,in my application I have done in the following manner.
using System;
using System.Web;
using System.Web.UI;
namespace ClassLibrary1
{
public class Class1:Control
{
public Class1()
{
}
}
}
5. Override a general Method of Control class Called Render:
protected override void Render(HtmlTextWriter writer)
{
writer.Write("This Is My Custom Control");
}
6. Our Custom Control is almost Created , now we are moving ahead by adding some functionality to our Control,i.e. we are goin to add a property in our control. Here is the full stuff.
using System;
using System.Web;
using System.Web.UI;
namespace ClassLibrary1
{
public class Class1:Control
{
private string _MyValue;
public string MyValue
{
get
{
return _MyValue;
}
set
{
_MyValue = value;
}
}
public Class1()
{
}
protected override void Render(HtmlTextWriter writer)
{
writer.Write("This Is My Custom Control"+ _MyValue);
}
}
}
7. Compile project. It will generate the DLL output (ClassLibrary1 In our case).
8. create a new ASP.NET Web application project, add a webform in it. Add the reference og our Custom Control DLL.
9. Register the custom control on the Web Forms design page.
(It will come near @Page Directive)
"<%@ Register TagPrefix="cc1" Namespace="ClassLibrary1" Assembly="ClassLibrary1" %>"
(Inside Form Tag)
"<cc1:Class1 id="Class11" runat="server"></cc1:Class1>"
10. Run the application and Enjoy………………….
-->We can Use the property of our custom control in code-behind of our webform like this:-
Class11.MyValue=" Hi Bheeshma";
-->we can add our custom control in the toolbox. By right click in the toolbox--> Add/Remove Items --> Browse and Select the DLL of our custom control(ClassLibrary1 in our case)--> Click ok. And it is Done and you can see it in your Toolbox.(Name will be Class1 in our Case)
Now we can directly drag and drop our control from the toolbox , no need of fancy registration as we did in Step 9.
D. Difference between User and Custom Control
1. User control is made for single-application environment, while custom control can be used in more than one application.
2. User Control are source in .ascx extension while Custom controls are .dll and can be reside in GAC.
3. User control are static in nature while in case of custom control we can add more dynamic features and can make them to work in similar way as the web server controls work.
Hope this will help to understand user/custom control.
Comments and feebacks are required to improve the english and content.
Thanks & Regards
Bheeshma P. Nayak
Monday, August 17, 2009
Removing Duplicate Rows
Here Is An Example To Remove The Duplicate Rows From A SQL Table Using CTE.
-- Create A Table with Some duplicate entries
CREATE TABLE MyTable (Fname VARCHAR(50), Lname VARCHAR(50))
INSERT INTO MyTable
SELECT 'Bheeshma', 'Nayak'
UNION ALL
SELECT 'Gyanendra', 'Nayak'
UNION ALL
SELECT 'Pratima', 'Nayak'
UNION ALL
SELECT 'Ramshri', 'Nayak'
UNION ALL
SELECT 'Bheeshma', 'Nayak'
UNION ALL
SELECT 'Gyanendra', 'Nayak'
GO /* Displaying All SIX Records */
SELECT *FROM MyTable
GO /* Deleteing Duplicate records Using Common Table Expression*/
WITH CTE (Fname,Lname, DupCount)
AS
(
SELECT Fname,Lname,ROW_NUMBER() OVER(PARTITION BY Fname,LnameORDER BY Fname) AS DupCount FROM MyTable
)
DELETE FROM CTE WHERE DupCount > 1
GO /* It Will give 4 Distinct Records */
SELECT *FROM MyTable
GO
Now Go and Enjoy....................
Thanks & Regards,
Bheeshma P. Nayak
Sunday, August 16, 2009
जैसी करनी वैसी भरनी
चाहे बोले बाग़ बगीचे , फुलवन झोली भर
चाहे बोले मग में कांटे , कांटे कांटे चल ,
करेगा जैसा पाएगा ,चाहे जैसा कर
चाहे भज ले हरि भजन को , जीवन पावन कर ,
करेगा जैसा पाएगा ,चाहे जैसा कर
चाहे कर ले सेवा जन की , प्रभु सेवक बन मर ,
करेगा जैसा पाएगा ,चाहे जैसा कर
My Great Grand Father
Late. Pt. Shri Rambharosh Nayak
AYURVEDACHARYA, Regd. No 1918
Class-A,Indian Medicine Board Of Lucknow(U.P)
परहित
जो कोऊ आपन लागो लिपटो , दया सबन पर कीजे
यही मंत्र औ जोग - जुगत है , दुःख नही काऊ देनें
सौ बातन की बात एक है , नाम धनी को लेनें
तम्बाखू
है लीला तेरी अपरम्पार तम्बाखू
जिनके पुरखों ने भीख न मांगी जाकर,
फैला देते वे हाथ तम्बाखू खातिर
जप में तप में सब चीज़ त्याज्य मानी है
पर त्याज्य तम्बाखू कभी नही मानी है
तू जाने किसका अवतार तम्बाखू ,
है लीला तेरी अपरम्पार तम्बाखू
युग परिवर्तन
मैने हर बस्ती तलाशी है
अब कहाँ सुख चैन मुस्काने है ,
भूख है छल है उदासी है
उम्र यौवन की शक्ल बूढी है ,
वाह क्या सूरत तराशी है
सड़क पर ईमान नंगा है ,
मौज में लुच्चा लफंगा है
जिसने सच के हाथ को थामा है,
उसी के पथ में अडंगा है
गाँव में डाका सफर में छल है,
शहर का संदेश दंगा है
इस तरह से परेशां हैं हम,
देश की छवि पर अचम्भा है
रो रही है कब से सिसक कर भोले वो ,
हाथ में जिसके तिरंगा है
Saturday, August 15, 2009
Independence Day Parade
Today i went to parade ground of secunderabad for watching the live parade, as i do not have pass so just seraching the entry gate for general public (i.e. those who do not have passes) ,somehow found my entrance. There were several entrance with tight security for awardees ,VIP's etc.....
Almost 1500 security person were present in the ground and roades nearby. Bomb disposal squads of the City Security Wing (CSW) already cheked the whole ground.
Initially we were not allowed to enter into the ground because we all (Mango People) are having mobiles with us. But after sometime they said to switchoff the mobiles and let us enter into the ground.
i was in the first row of the Aam janta with one of my collegue Himanshu Mishra,then the celebration started with parade which has 20 different contingent which includes red cross,KV students,NCC ,Bands and Police forces etc...
This is the 60th Independence day celebrating in this ground of secunderabad,where first time in the history of this ground the parade is leaded by a Lady IPS officer,she was a double gold medalist In her Carrer.
commentary was nice , there are three commentator for different language(Telgu,Urdu,English).
Urdu commentary was aewsome , i love that accent.
Finally Cheif Guest C.M Y.S.Rajashekhar Reddy Came, hoisted the flag and attended the parade with full respect.
Finally the speech of the CM is goin to begin , and we left from there, as it was goin to be in Telgu.
This is my today's experice from Morning 6-10AM.
Thanks & Regards
Bheeshma P. Nayak
My Prayer To God(Independence Day)
Om Dyau Shanti Rantariksha GwamShantiPrithvi Shanti RapahShanti Roshadhayah Shanti Vanas PatayahShanti Vishwed Devah Shanti BrahmaSarvag WamShantiShanti Reva Shanti Sa Ma Shanti RedhiOm Shanti Shanti Shanti Om
Unto the Heaven be Peace, Unto the Sky and the Earth be Peace,Peace be unto the Water, Unto the Herbs and Trees be Peace,Unto all the Gods be Peace, Unto Brahma and unto All be Peace.And may We realize that Peace.Om Peace Peace Peace Bheeshma P. Nayak
Friday, August 14, 2009
India's First Independence Day Celebrations In Delhi AUGUST 15,1947
Constructor In C#
Constructor is a method of a class which gets automatically executed when an object of that class is created or when the class is initlized.
--------------------------------------------------------------------------------------
Types of Constructor
A difficult Question, it can be categorized in many ways.
According to one way: There are two types of Constuctor, which is given as follows:
Default Constructor
A constructor that takes no parameters is called a default constructor. It automatically get called when a object of the class is created with no arguments.
Parameterized Constructor
This one is almost same as default constructor, the only thing is, it takes parameters.
According to second way: There are also two types of Constructor, which is given as follows:
Static Constructor/Class Constructor
It cannot be overloaded.
It takes no parameter and can access static members only
It executes only once for a class.
It should not be declared with any access modifier.
It is called automatically,and by no way its execution can be stopped.
It executes before any of the static member of the class is referenced
Instance Constructor/Non Static Constructor/type constructor. /type initilizers
They can be public, private, protected, external, or internal.
A private constructor prevents the creation of the object of the class (except in nested classes)and also prevent the Inheritance.
A class which contains internal constructor,object of this class can not be created in different assembly.
A class which contains protected constructor,object of this class can not be created directly,instead we need to create the object of the child class which in turn invoke the base class protected construcor.
One Important point is that a public constructor can access a private constructor of the same class by constructor chaining.
Example 1:-
class MyClass
{
public MyClass(): this("Hi")
{
Console.WriteLine("Default Constructor");
}
private MyClass(string val)
{
Console.WriteLine("Parameterized Constructor");
}
public static void Main(string []args)
{
MyClass Obj= new MyClass();
Console.ReadLine ();
}
}
The above program show how constructor chaining is implemented. In the above prog, default constructor first invoke the parameterized Constructor and then invoke itself.
Output Will be :-
Parameterized Constructor
Default Constructor
Example 2:-
Protected Constructor Can be called by its child class only, they can not be invoked directly by creating the object of that class. Following example demonstrate it:
class MyBase
{
protected MyBase(string s)
{
Console.WriteLine("Called By MyChild");
}
}
class MyChild: MyBase
{
public MyChild() : base ("Hello Father") {}
}
class MainClass
{
public static void Main(string []args)
{
MyChild Obj = new MyChild( ); // Fine
MyBase Obj1 = new MyBase("Hello Father"); //Error-- Can Be Invoke by Child Class Only
}
}
--------------------------------------------------------------------------------------
Points To Remember
Its name must be same as the name of class
It does not have return type ,not even void.
They can’t be inherited, although a derived class can class the base class constructor.
Declaring more than one constructors in a class with different sets of parameters known as Constructor overloading.
A constructor can call another constructor using :this() .
They can not be "virtual"
They are called in the order of inheritance(Exception is static Constructor)
--------------------------------------------------------------------------------------Constuctor Overloading
We can have more than One constructor in a class with different. these constructors are called Overloaded constructors. They must differ in their number of arguments, type of arguments,order of arguments.
--------------------------------------------------------------------------------------
Constructor Chaining
The concept which allows one constructor to invoke another constructor is called Constructor Chaining . for this purpose we either use :base (parameters) or : this (parameters) just before the definition of the constructor.
--------------------------------------------------------------------------------------
Note:
When a chidlls class object is created,i.e. its default constructor ,It first calls the default constructor Of base class ,then execute itself. Similarly whenever a paramerized constructor Of child need to invoke by it’s object ,by default it calls the base class default constructor again.
By Doin like this " public ClassName (string strName) : base(strName) "will call the base class paramerized constructor.
--------------------------------------------------------------------------------------
Thanks & Regards
Bheeshma P. Nayak
Thursday, August 13, 2009
.Net Interview Questions- Part:2
Hi All,
This Is the second post for >net Interview Question:-
Can you give a overview of ADO.NET architecture ?
What are the two fundamental objects in ADO.NET ?
What is difference between dataset and datareader ?
What are major difference between classic ADO and ADO.NET ?
What is the use of connection object ?
What is the use of command objects and what are the methods provided by the command object ?
What is the use of dataadapter ?
What are basic methods of Dataadapter ?
What is Dataset object?
What are the various objects in Dataset ?
How can we connect to Microsoft Access , Foxpro , Oracle etc ? How do we connect to SQL SERVER , which namespace do we use ?
How do we use stored procedure in ADO.NET and how do we provide parameters to the stored procedures?
How can we force the connection object to close after my datareader is closed ?
I want to force the datareader to return only schema of the datastore rather than data ?
How can we fine tune the command object when we are expecting a single row or a single value ? Which is the best place to store connectionstring in .NET projects ?
What are steps involved to fill a dataset ?
How can we use dataadapter to fill a dataset ?
What are the various methods provided by the dataset object to generate XML?
How can we save all data from dataset ?
How can we check that some changes have been made to dataset since it was loaded ?
How can we cancel all changes done in dataset ?
How do we get values which are changed in a dataset ?
How can we add/remove row’s in “DataTable” object of “DataSet” ?
What’s basic use of “DataView” ?
What’s difference between “DataSet” and “DataReader” ?
Why is DataSet slower than DataReader ?
How can we load multiple tables in a DataSet ?
How can we add relation’s between table in a DataSet ?
What’s the use of CommandBuilder ?
What’s difference between “Optimistic” and “Pessimistic” locking ?
How many way’s are there to implement locking in ADO.NET ?
How can we perform transactions in .NET?
What’s difference between Dataset. clone and Dataset. copy ?
Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?
Explain in detail the fundamental of connection pooling?
What is Maximum Pool Size in ADO.NET Connection String?
How to enable and disable connection pooling?
This Is the part 2 of the interview questions. Soon you'll receive the
next part of it.
Thanks & Regards
Bheeshma P. Nayak
Dare To Accept Truth
Satyam computer services limited
From: B. Ramalinga Raju
Chairman Satyam Computer services Limited January 7, 2009
Dear Board Members,
"It is with deep regret and tremendous burden that I am carrying on my conscience, that I would like to bring the following facts to your notice:
1. The Balance Sheet carries as of September 30, 2008, a) Inflated (non-existent) cash and bank balances of Rs 5,040 crore (as against Rs 5,361 crore reflected in the books); b) An accrued interest of Rs 376 crore, which is non-existentc) An understated liability of Rs 1,230 crore on account of funds arranged by me;d) An overstated debtors' position of Rs 490 crore (as against Rs 2,651 reflected in the books);
2. For the September quarter(Q2) we reported a revenue of Rs 2,700 crore and an operating margin of Rs 649 crore(24 per cent of revenue) as against the actual revenues of Rs 2,112 crore and an actual operating margin of Rs 61 crore (3 per cent of revenues). This has resulted in artificial cash and bank balances going up by Rs 588 crore in Q2 alone.
The gap in the balance sheet has arisen purely on account of inflated profits over several years (limited only to Satyam standalone, books of subsidiaries reflecting true performance).
What started as a marginal gap between actual operating profit and the one reflected in the books of accounts continued to grow over the years.
It has attained unmanageable proportions as the size of the company operations grew significantly (annualised revenue run rate of Rs 11,276 crore in the September quarter, 2008, and official reserves of Rs 8,392 crore).
The differential in the real profits and the one reflected in the books was further accentuated by the fact that the company had to carry additional resources and assets to justify a higher level of operations thereby significantly increasing the costs.
Every attempt made to eliminate the gap failed. As the promoters held a small percentage of equity, the concern was that poor performance would result in the takeover, thereby exposing the gap. It was like riding a tiger, not knowing how to get off without being eaten.
The aborted Maytas acquisition deal was the last attempt to fill the fictitious assets with real ones. Maytas' investors were convinced that this is a good divestment opportunity and a strategic fit.
One Satyam's problem was solved, it was hoped that Maytas' payments can be delayed. But that was not to be. What followed in the last several days is common knowledge.
I would like the board to know:1. That neither myself, nor the Managing Director (including our spouses) sold any shares in the last eight years - excepting for a small proportion declared and sold for philanthropic purposes.
2. That in the last two years a net amount of Rs 1,230 crore was arranged to Satyam (not reflected in the books of Satyam) to keep the operations going by resorting to pledging all the promoter shares and raising funds from known sources by giving all kinds of assurances (statement enclosed only to the members of the board).
Significant dividend payments, acquisitions, capital expenditure to provide for growth did not help matters. Every attempt was made to keep the wheel moving and to ensure prompt payment of salaries to the associates. The last straw was the selling of most of the pledged shares by the lenders on account of margin triggers.
3. That neither me nor the managing director took even one rupee/dollar from the company and have not benefited in financial terms on account of the inflated results.
4. None of the board members, past or present, had any knowledge of the situation in which the company is placed. Even business leaders and senior executives in the company, such as, Ram Mynampati, Subu D, T R Anand, Keshab Panda, Virender Agarwal, A S Murthy, Hari T, S V Krishnan, Vijay Prasad, Manish Mehta, Murli V, Shriram Papani, Kiran Kavale, Joe Lagioia, Ravindra Penumetsa, Jayaraman and Prabhakar Gupta are unaware of the real situation as against the books of accounts. None of my or managing directors' immediate or extended family members has any idea about these issues.
Having put these facts before you, I leave it to the wisdom of the board to take the matters forward. However, I am also taking the liberty to recommend the following steps:
1. A task force has been formed in the last few days to address the situation arising out of the failed Maytas acquisition attempt.
This consists of some of the most accomplished leaders of Satyam: Subu D, T.R. Anand, Keshab Panda and Virendra Agarwal, representing business functions, and A S Murthy, Hari T and Murali V representing support functions.
I suggest that Ram Mynampati be made the chairman of this Task Force to immediately address some of the operational matters on hand. Ram can also act as an interim CEO reporting to the board.
2. Merrill Lynch can be entrusted with the task of quickly exploring some merger opportunities.
3. You may have a 'restatement of accounts’ prepared by the auditors in light of the facts that I have placed before you.
I have promoted and have been associated with Satyam for well over 20 years now. I have seen it grow from few people to 53,000 people, with 185 Fortune 500 companies as customers and operations in 66 countries. Satyam has established an excellent leadership and competency base at all levels.
I sincerely apologise to all Satyamites and stakeholders, who have made Satyam a special organisation, for the current situation. I am confident they will stand by the company in this hour of crisis.
In light of the above, I fervently appeal to the board to hold together to take some important steps. TR Prasad is well placed to mobilise a support from the government at this crucial time.
With the hope that members of the Task Force and the financial advisor, Merrill Lynch (now Bank of America), will stand by the company at this crucial hour, I am marking copies of the statement to them as well.
Under the circumstances, I am tendering the resignation as the chairman of Satyam and shall continue in this position only till such time the current board is expanded. My continuance is just to ensure enhancement of the board over the next several days or as early as possible.
I am now prepared to subject myself to the laws of the land and face the consequences thereof.
(B Ramalinga Raju)
Copies marked to:
1. Chairman SEBI
2. Stock Exchanges.
.Net Interview Questions- Part:1
What is a IL?
What is a CLR?
What is a CTS?
What is a CLS(Common Language Specification)?
What is a Managed Code?
What is a Assembly ?
What are different types of Assembly?
What is NameSpace?
What is Difference between NameSpace and Assembly?
What is Manifest?
Where is version information stored of a assembly ?
Is versioning applicable to private assemblies?
What is GAC ?
What is concept of strong names ?
How to add and remove a assembly from GAC?
What is Delay signing ?
What is garbage collection?
Can we force garbage collector to run ?
What is reflection?
What are different type of JIT ?
What are Value types and Reference types ?
What is concept of Boxing and Unboxing ?
What’s difference between VB.NET and C# ?
What’s 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’s the difference between Convert.toString and .toString() method ?
What is Native Image Generator (Ngen.exe)?
Can We have two version of the same assembly in GAC?
I want my client to make choice of which assembly to choose?
What is CodeDom?
How can we use COM Components in .NET?
What is RCW ?
Once i have developed the COM wrapper do i have to still register the COM in registry?
How can we use .NET components in COM?
What is CCW (COM callable wrapper) ?
What caution needs to be taken in order that .NET components is compatible with COM ?
How can we make Windows API calls in .NET?
When we use windows API in .NET is it managed or unmanaged code ?
What is COM ?
What is Reference counting in COM ?
Can you describe IUKNOWN interface in short ?
Can you explain what is DCOM ?
How do we create DCOM object in VB6?
How to implement DTC in .NET ?
How many types of Transactions are there in COM + .NET ?
How do you do object pooling in .NET ?
What are types of compatibility in VB6?
What is equivalent for regsvr32 exe in .NET ?
What is Multi-tasking ?
What is Multi-threading ?
What is a Thread ?
Did VB6 support multi-threading ?
Can we have multiple threads in one App domain ?
Which namespace has threading ?
Can you explain in brief how can we implement threading ?
How can we change priority and what the levels of priority are provided by .NET ?
What does Addressof operator do in background ?
How can you reference current thread of the method ?
What's Thread.Sleep() in threading ?
How can we make a thread sleep for infinite period ?
What is Suspend and Resume in Threading ?
What the way to stop a long running thread ?
How do i debug thread ?
What's Thread.Join() in threading ?
What are Daemon thread's and how can a thread be created as Daemon?
When working with shared data in threading how do you implement synchronization ?
Can we use events with threading ?
How can we know a state of a thread?
What is a monitor object?
What are wait handles ?
What is a mutex object ?
what is ManualResetEvent and AutoResetEvent ?
What is ReaderWriter Locks ?
How can you avoid deadlock in threading ?
What’s difference between thread and process?
What is a application domain?
What is .NET Remoting ?
Which class does the remote object has to inherit ?
What are two different types of remote object creation mode in .NET ?
Describe in detail Basic of SAO architecture of Remoting?
What are the situations you will use singleton architecture in remoting ?
What is fundamental of published or precreated objects in Remoting ?
What are the ways client can create object on server in CAO model ?
Are CAO stateful in nature ?
In CAO model when we want client objects to be created by “NEW” keyword is there any precautions to be taken ?
Is it a good design practice to distribute the implementation to Remoting Client ?
What is LeaseTime,SponsorshipTime ,RenewonCallTime and LeaseManagerPollTime?
Which config file has all the supported channels/protocol ?
How can you specify remoting parameters using Config files ?
Can Non-Default constructors be used with Single Call SAO?
What are the limitation of constructors for Single call SAO ?
How can we call methods in remoting Asynchronously ?
What is Asynchronous One-Way Calls ?
What is marshalling and what are different kinds of marshalling ?
What is ObjRef object in remoting ?
What is a WebService ?
What is UDDI ?
What is DISCO ?
What is WSDL?
What the different phase/steps of acquiring a proxy object in Webservice ?
What is file extension of Webservices ?
Which attribute is used in order that the method can be used as WebService ?
What are the steps to create a webservice and consume it ?
Do webservice have state ?
What is application object ?
What’s the difference between Cache object and application object ?
How can get access to cache object ?
What are dependencies in cache and types of dependencies ?
Can you show a simple code showing file dependency in cache ?
What is Cache Callback in Cache ?
What is scavenging ?
What are different types of caching using cache object of ASP.NET?
How can you cache different version of same page using ASP.NET cache object ?
How will implement Page Fragment Caching ?
What are ASP.NET session and compare ASP.NET session with classic ASP session variables?
Which various modes of storing ASP.NET session ?
Is Session_End event supported in all session modes ?
What are the precautions you will take in order that StateServer Mode work properly ?
What are the precautions you will take in order that SQLSERVER Mode work properly ?
Where do you specify session state mode in ASP.NET ?
What are the other ways you can maintain state ?
What are benefits and Limitation of using Hidden fields ?
What is ViewState ?
Do performance vary for viewstate according to User controls ?
What are benefits and Limitation of using Viewstate for state management?
How an you use Hidden frames to cache client data ?
What are benefits and Limitation of using Hidden frames?
What are benefits and Limitation of using Cookies?
What is Query String and What are benefits and Limitation of using Query Strings?
What is Object Oriented Programming ?
What’s a Class ?
What’s a Object ?
What’s the relation between Classes and Objects ?
What are different properties provided by Object-oriented systems ?
Can you explain different properties of Object Oriented Systems?
What’s difference between Association , Aggregation and Inheritance relationships?
How can we acheive inheritance in VB.NET ?
What are abstract classes ?
What’s a Interface ?
What is difference between abstract classes and interfaces?
What is a delegate ?
What are event’s ?
Do events have return type ?
Can event’s have access modifiers ?
Can we have shared events ?
What is shadowing ?
What’s difference between Shadowing and Overriding ?
What’s difference between delegate and events?
If we inherit a class do the private variables also get inherited ?
What are different accessibility levels defined in .NET ?
Can you prevent a class from overriding ?
What’s the use of “MustInherit” keyword in VB.NET ?
Why can not you specify accessibility modifier in Interface ?
What are similarities between Class and structure ?
What’s the difference between Class and structure’s ?
What does virtual keyword mean ?
What are shared (VB.NET)/Static(C#) variables?
What is Dispose method in .NET ?
Whats the use of “OverRides” and “Overridable” keywords ?
Where are all .NET Collection classes located ?
What is ArrayList ? What’s a HashTable ?
What’s difference between HashTable and ArrayList ?
What are queues and stacks ?
What is ENUM ?
What is nested Classes ?
What’s Operator Overloading in .NET?
What’s the significance of Finalize method in .NET?
Why is it preferred to not use finalize for clean up?
How can we suppress a finalize method?
What’s the use of DISPOSE method?
How do I force the Dispose method to be called automatically, as clients can forget to call Dispose method?
In what instances you will declare a constructor to be private?
Can we have different access modifiers on get/set methods of a property ?
If we write a goto or a return statement in try and catch block will the finally block execute ?
What is Indexer ?
Can we have static indexer in C# ?
In a program there are multiple catch blocks so can it happen that two catch blocks are executed ?
What is the difference between System.String and System.StringBuilder classes?
What’s the sequence in which ASP.NET events are processed ?
In which event are the controls fully loaded ?
How can we identify that the Page is PostBack ?
How does ASP.NET maintain state in between subsequent request ?
What is event bubbling ?
How do we assign page specific attributes ?
Administrator wants to make a security check that no one has tampered with ViewState , how can he ensure this ?
What’s the use of @ Register directives ?
What’s the use of SmartNavigation property ?
What is AppSetting Section in “Web.Config” file ?
Where is ViewState information stored ?
What’s the use of @ OutputCache directive in ASP.NET?
How can we create custom controls in ASP.NET ?
How many types of validation controls are provided by ASP.NET ?
Can you explain what is “AutoPostBack” feature in ASP.NET ?
How can you enable automatic paging in DataGrid ?
What’s the use of “GLOBAL.ASAX” file ?
What’s the difference between “Web.config” and “Machine.Config” ?
What’s a SESSION and APPLICATION object ?
What’s difference between Server.Transfer and response.Redirect ?
What’s difference between Authentication and authorization?
What is impersonation in ASP.NET ?
Can you explain in brief how the ASP.NET authentication process works?
What are the various ways of authentication techniques in ASP.NET?
How does authorization work in ASP.NET?
What’s difference between Datagrid , Datalist and repeater ?
From performance point of view how do they rate ?
What’s the method to customize columns in DataGrid?
How can we format data inside DataGrid?
How will decide the design consideration to take a Datagrid , datalist or repeater ?
Difference between ASP and ASP.NET?
What are major events in GLOBAL.ASAX file ?
What order they are triggered ?
Do session use cookies ?
How can we force all the validation control to run ?
How can we check if all the validation control are valid and proper ?
If you have client side validation is enabled in your Web page , Does that mean server side code is not run?
Which JavaScript file is referenced for validating the validators at the client side ?
How to disable client side script in validators?
I want to show the entire validation error message in a message box on the client side?
You find that one of your validation is very complicated and does not fit in any of the validators , so what will you do ?
What is Tracing in ASP.NET ?
How do we enable tracing ?
What exactly happens when ASPX page is requested from Browser?
How can we kill a user session ?
How do you upload a file in ASP.NET ?
How do I send email message from ASP.NET ?
What are different IIS isolation levels?
ASP used STA threading model , whats the threading model used for ASP.NET ?
Whats the use of attribute ?
Explain the differences between Server-side and Client-side code?
Can you explain Forms authentication in detail ?
How do I sign out in forms authentication ?
If cookies are not enabled at browser end does form Authentication work?
How to use a checkbox in a datagrid?
What are the steps to create a windows service in VB.NET ?
What’s the difference between “Web farms” and “Web garden”?
How do we configure “WebGarden”?
What is the main difference between Gridlayout and FlowLayout ?
What are design patterns ?
What’s difference between Factory and Abstract Factory Pattern’s?
What’s MVC pattern?
How can you implement MVC pattern in ASP.NET?
How can we implement singleton pattern in .NET?
How do you implement prototype pattern in .NET?
How to implement cloning in .NET ?
What is shallow copy and deep copy ?
What are the situations you will use a Web Service and Remoting in projects?
Can you give a practical implementation of FAÇADE patterns?
How can we implement observer pattern in .NET?
What is three tier architecture?
Have you ever worked with Microsoft Application Blocks, if yes then which?
What is Service Oriented architecture?
What are different ways you can pass data between tiers?
What is Windows DNA architecture?
What is aspect oriented programming?
What is the namespace in which .NET has the data functionality classes ?
This Is the part 1 of the intervew questions. Soon you'll receive the next part of it.
Thanks & Regards
Bheeshma P. Nayak
Wednesday, August 12, 2009
Please Listen
This is one of my favourite Poem.( Source: From Chicken soup)
When I ask you to listen to me and you start giving me advice, you have not done what I asked.
When I ask you to listen to me and you begin to tell me why I shouldn't feel that way, you are trampling on my feelings.
When I ask you to listen to me and you feel you have to do something to solve my problem, you have failed me, strange as that may seem.
Listen! All I ask is that you listen. Don't talk or do - just hear me.
Advice is cheap; 20 cents will get you both Dear Abby and Billy Graham in the same newspaper, and I can do for myself; I am not helpless. Maybe discouraged and faltering, but not helpless.
When you do something for me that I can and need to do for myself, you contribute to my fear and inadequacy. But when you accept as a simple fact that I feel what I feel, no matter how irrational, then I can stop trying to convince you and get about this business of understanding what's behind this irrational feeling.
And when that's clear, the answers are obvious and I don't need advice. Irrational feelings make sense when we understand what's behind them.
Perhaps that's why prayer works, sometimes,for some people - because God is mute, and he doesn't give advice or try to fix things. God just listens and lets you work it out for yourself.
So please listen, and just hear me.And if you want to talk, wait a minutefor your turn - and I will listen to you.
Thanks & Regards
Bheeshma P. Nayak







