HR Interview Question – Tell me about your self

Whenever in any interview interviewer asks any interviewee to tell about them selves, they actually want to hear or listen the points that actually do their job, not their life history.

Common mistake any interviewee does are:-

A) Fresher

1) Telling about the life history.

2) Something not related to the job.

3) Telling everything but not their strong points.

4) Not Clear with the content and lack of confidence.

B) Experienced Professionals

1) Telling about only the past companies.

2) Telling about the personal experiences.

3) Not indicating their Strong Points.

What actually the Interviewer wants or you are expected to tell :-

1) Your most Strong points.

2) Your most marketable points or strengths that will help the company do their job.

3) Modify the answer according to the jobs requirement and highlight only those points that will help the company do the job.

4) Always be confident and clear in what you are delivering.

5) Make it very short and limit to a max of 5 points and one minute.

6) Don’t include your life history.

7) Look into the eyes of the interviewer and be confident in answering.

8)  Give specific proof to support your statement.

9) Never take more than a minute then the interviewer might loose their interest and might not listen to what you are about to tell.

Reference : Dilip Kumar Jena (https://mstechexplore.wordpress.com)

ASP.NET – How to work with GridView

Today we are going to see how to work with Grid View Control.

Here is an example how are we going to get a repeater after we finished coding.

Here I am using AdventureWorks in SQL SERVER which can be downloaded from codeplex.

The table I am using is DimCustomer and fields are :

1)FirstName

2)MiddleName

3)LastName

4)BirthDate

5)CustomerKey

Step 1 :  Add the control in the <body> tag in page in .aspx side let it be grdView.aspx

</pre>
<form id="frmExmGrdView" runat="server">
    <asp:GridView ID="grd" runat="server" CssClass="gdview" HeaderStyle-CssClass="hd" AutoGenerateColumns="false" BorderStyle="None">
    <Columns>
    <asp:BoundField DataField="FirstName" HeaderText="Login" ItemStyle-Width="40" ItemStyle-HorizontalAlign="Left" ></asp:BoundField>
    <asp:BoundField DataField="MiddleName" HeaderText="Initial" ItemStyle-Width="20" ItemStyle-HorizontalAlign="Left" ></asp:BoundField>
    <asp:BoundField DataField="LastName" HeaderText="Name" ItemStyle-Width="60" ItemStyle-HorizontalAlign="Left" ></asp:BoundField>
    <asp:BoundField DataField="BirthDate" HeaderText="DateAdded" ItemStyle-Width="40" ItemStyle-HorizontalAlign="Left" HtmlEncode="false" DataFormatString={0:d}></asp:BoundField>
    </Columns>
    </asp:GridView>
    </form>
<pre>

NOTE: Dont forget to make the form tag as runat = “server “

otherwise an error will occur because you are trying to insert the data from .cs

side but u can only access it when u make runat = “server “

STEP 2:  Now insert the data from the code behind (.cs side) in Page_Load event

 

protected void Page_Load(object sender, EventArgs e)
    {
        SqlConnection con = new SqlConnection("Server=localhost;UID=sa;PWD=dilip;Database=AdventureWorksDW");
        string sSQL = "Select top 5 * from dbo.DimCustomer";
        SqlCommand cmd = new SqlCommand(sSQL, con);
        con.Open();
        SqlDataReader dtrClient = cmd.ExecuteReader();
        grd.DataSource = dtrClient;
        grd.DataBind();
        con.Close();
    }

The last 2 lines binding the data to the repeater and starting remaining lines is to establish connection to database.

the output will come as shown above .

Reference : Dilip Kumar Jena ( https://mstechexplore.wordpress.com )

ASP.NET How to work with Repeater

Today we are going to see how to work with Repeater Control.

Here is an example how are we going to get a repeater after we finished coding.

Here I am using AdventureWorksDW2008R2 in SQL SERVER which can be downloaded from http://www.codeplex.com.

The table I am using is DimCustomer and fields are :

1)FirstName

2)MiddleName

3)LastName

4)BirthDate

5)CustomerKey

Step 1 :  Upload the control in the page in .aspx side let it be default.aspx

<form id=”frmExample” runat=”server”>

<asp:Repeater ID=”rptList” runat=”server” OnItemDataBound=”rptList_ItemDataBound”>

<HeaderTemplate>

<table border=”1″ cellpadding=”0″ cellspacing=”0″>

12px; color:White;”>

<th>

<asp:Label ID=”Label14″ Text=”Login” runat=”server”></asp:Label>

</th>

<th>

<asp:Label ID=”Label1″ Text=”First Name” runat=”server”></asp:Label>

</th>

<th>

<asp:Label ID=”Label2″ Text=”Last Name” runat=”server”></asp:Label>

</th>

<th>

<asp:Label ID=”Label3″ Text=”Date Added” runat=”server”></asp:Label>

</th>

<th>

<asp:Label ID=”Label6″ Text=”Delete” runat=”server”></asp:Label>

</th>

</tr>

</HeaderTemplate>

<ItemTemplate>

<tr>

<td>

<asp:LinkButton ID=”lbnLogin” Text='<%# Eval(“FirstName”) %>’ runat=”server”</asp:

OnClick=”lnkClient_Click” CommandArgument='<%# Eval(“CustomerKey“).ToString() %>’>

LinkButton>

</td>

<td>

<asp:LinkButton ID=”lbnFirstName” Text='<%# Eval(“MiddleName”).ToString() %>'</asp:

runat=”server”

OnClick=”lnkClient_Click” CommandArgument='<%# Eval(“CustomerKey“).ToString() %>’>

LinkButton>

</td>

<td>

<asp:LinkButton ID=”LinkButton2″ Text='<%# Eval(“LastName”).ToString() %>'</asp:

runat=”server”

OnClick=”lnkClient_Click” CommandArgument='<%# Eval(“CustomerKey“).ToString() %>’>

</asp:LinkButton>

</td>

<td>

<asp:LinkButton ID=”LinkButton1″ Text='<%# string.Format(“{0:d}”, Eval(“BirthDate”)) %>’ runat=”server”

OnClick=”lnkClient_Click” CommandArgument='<%# Eval(“CustomerKey“).ToString() %>’>

</asp:LinkButton>

</td>

<td>

<asp:LinkButton ID=”lbnDelete” Text=”delete” runat=”server”

OnClick=”lbnDelete_Click” CommandArgument='<%# Eval(“CustomerKey“).ToString() %>’>

</asp:LinkButton>

</td>

</tr>

</ItemTemplate>

<FooterTemplate>

</table>

</FooterTemplate>

</asp:Repeater>

</form>

NOTE: Dont forget to make the form tag as runat = “server “

otherwise an error will occur because you are trying to insert the data from .cs

side but u can only access it when u make runat = “server “

STEP 2:  Now insert the data from the code behing

int Page_Load event

SqlConnection con = new SqlConnection(“Server=localhost;UID=xx;PWD=xx;

Database=AdventureWorksDW2008R2″);

string sSQL = “Select top 5 * from dbo.DimCustomer”;

SqlCommand cmd = new SqlCommand(sSQL, con);

con.Open();

SqlDataReader dtrClient = cmd.ExecuteReader();

rptList.DataSource = dtrClient;

rptList.DataBind();

con.Close();

/*along with it*/ write these dummy function later you can implement them as you like .

protected void lnkClient_Click(object sender, EventArgs e)

{ }

protected void lbnDelete_Click(object sender, EventArgs e)

{ }

protected void rptList_ItemDataBound(object sender, RepeaterItemEventArgs e)

{ }

The last 2 lines binding the data to the repeater and starting remaining lines is to establish connection to database.

the output will come as shown above .

Reference : Dilip Kumar Jena ( https://mstechexplore.wordpress.com )

ASP.net – How to make text box as Read Only

There are two ways of doing it without using javascript:

1) In .aspx side in the declaration of TextBox use the property ReadOnly=“true” and the user wont be able to alter the text box text unless specified from the code behind .cs side.

2)in .cs side where in we can write txtUserName.ReadOnly = true; we can write it  in page load or in button click event or to show default text in text box can supply the text from code behind like this  txtUserName.Text = “Dilip”; where  txtUserName is the ID of the TextBox.

Reference : Dilip Kumar Jena ( https://mstechexplore.wordpress.com )

DOT NET – How to make a button as default button and set Focus on a particular text box

In the initial days when i was new to development side and in some site i used to login straight away when i enter username and password and hit Enter key on my keyboard.

I used to think how is this happening but never had any answer but now i am going to show how thats possible.

In this post I will be talking about how  to make any button Default button and set Focus on a particular text box in any page thats displayed.

Ex: Make a test site and go to default.aspx

Step 1:

in <body> tag write the following code

<body>

<form id=”frmExample” runat=”server” defaultbutton=”btnLogin” defaultfocus=”txtUserName”>

<table><tr><td width=”50%”>

Welcome to the Example Web site from dilip

</td>

<td width=”50%”>

<table>

<tr><td><asp:TextBox ID=”txtUserName” runat=”server” Text=”UserName” /></td><td><asp:TextBox ID=”txtPassword” runat=”server” Text=”Password”/></td></tr>

<tr><td><asp:Button ID=”btnLogin” runat=”server” Text=”Login” onclick=”btnLogin_Click”/></td><td><asp:Button ID=”btnSignIn” runat=”server” Text=”Signup”/></td></tr>

</table>

</td>

</tr>

</table>

</form>

</body>

Note: Here the beauty is that i have login and singnup button and i made defaultbutton as login button, and defaultfocus on username text box so whenever this page is viewed from any web browser focus will be on username text box and default button will be login button so when u hit enter it will invoke login button so simple.

 Step 2: see  carefully i have a function onclick=”btnLogin_Click” now press F7 key and go to .cs side of the same page or right click on the mouse and select view code .

and write the following code in .cs side

protected void btnLogin_Click(object sender, EventArgs e)

{

Response.Write(“Default Button was clicked and u are now logged In”);

Response.End();

}

Note: Here another concept when ever you enter key this method will be invoked and at the same time there wont be any other you can see that means response is closed just to make you feel that you really logged in but actually u are in same page.

the output is some this like this :

First Time when visited:

you can see username text box is in focus.

Then when enter key is pressed:

Reference : Dilip Kumar Jena ( https://mstechexplore.wordpress.com )

DOT NET – Difference between string and string builder

In Dot Net there will be many cases where in we need to operate on strings and first thing we remember is using system.String but there are certainly many points we need to remember and consider before we operate on strings.

1) Performance.

2)how many times we need to concatenate.

Lets take an example for concatenate five strings.

EX 1. Using System.String

System.String str =“My Name is dilip”;

str += “and i am”; str += “working on “;

str += “Post of “;

str += “difference between string and string builder”;

Response.Write(str);

and the expected output well you probably guessed it right

“My Name is dilipand i amworking on Post of difference between string and string builder”

Now what has happed? yes the important question now how many times we have appended the str variable those number of times string was created in memory location and abandoned when a new string is created and later waiting for garbage collection.

This leads to memory wastage and degradation of performance because string are immutable(that means any change to string causes a runtime to create a new string and abandon old one).

Think about the situation where in u need to work on 100 or more strings????

Dot Net has answer for it in the form of System.Text.StringBuilder class

EX2. Same Example using StringBuilder

StringBuilder sb = new StringBuilder();

sb.Append( “My Name is dilip”);

sb.Append( “and i am”);

sb.Append( “working on “);

sb.Append( “Post of “);

sb.Append( “difference between string and string builder”);

and the output is same as previous

“My Name is dilipand i amworking on Post of difference between string and string builder”

But this time there was only one string created in memory dynamically and modified as we append the new string, by this there is not much garbage collection and also helps improve performance. Append is taken only for example there are a lot of other functions which are just waiting for you to invoke.Happy coding.

Reference : Dilip Kumar Jena ( https://mstechexplore.wordpress.com )

What is HTTPS and Advantages of it

HTTPS – Secure HTTP

The HyperText Transport Protocol (Secure), the standard encrypted communication mechanism on the World Wide Web and this is actually just HTTP over SSL.

Advantages of HTTPS

  1. Same as HTTP, only encrypted for security purposes. HTTPS (Hypertext Transfer Protocol over Secure Socket Layer, or HTTP over SSL) is a Web protocol built into its browser that encrypts and decrypts user page requests as well as the pages that are returned by the Web server and developed by Netscape. HTTPS is really just the use of the Netscape’s Secure Socket Layer (SSL) as a sublayer under its regular HTTP application layering.
  1. The Hypertext Transport Protocol, Secure, the standard SSL communication mechanism of World Wide Web.(1) (HyperText Transport Protocol Secure) The protocol for accessing a secure Web server and using HTTPS in the URL instead of HTTP directs the message to a secure port address rather than the default Web port address of 80. The session is then managed by the security protocol.

    (2) (HyperText Transport Protocol Secure) The protocol for accessing a secure Web server and using HTTPS in the URL instead of HTTP directs the message to a secure port number rather than the default Web port number of 80. The session is then managed by a security protocol.

    (3) (HyperText Transport Protocol Server) A Web server that runs under Windows NT, developed by the European Microsoft Windows Academic Centre.

  1. HTTP layered over the SSL protocol.
  1. Secure Hypertext Transfer Protocol.
  1. Secure HyperText Transfer Protocol
  1. Same as HTTP but provides secure Internet communication using SSL.
    A type of server software which provides the ability for “secure” transactions to take place on the World Wide Web. If a Web site is running off a HTTPS server you can type in HTTPS instead of HTTP in the URL section of your browser to enter into the “secured mode”. Windows NT HTTPS and Netscape Commerce server software support this protocol. SEE ALSO: proxy server, secure server and commerce server.
  1. https is ordinary http exchanged over an SSL-encrypted session.A new implementation of the HTTP protocol that provides for more secure web communications by including encryption methods.
  2. A variant of HTTP that encrypts messages for security.(HyperText Transfer Protocol Secure) A secure protocol for sending information forth and back over the Internet and the HTTPS protocol most frequently relies on the SSL (Secure Socket Layer) encryption system but others such as TLS (Transport layer security) are also available. Every attempt has been made to provide you with the correct acronym for HTTPS and if we missed the mark, we would greatly appreciate your help by entering the correct or alternate meaning in the box below. Definitions have been compiled multiple results provided for your review and popular search engine.

Reference : Dilip Kumar Jena ( https://mstechexplore.wordpress.com )