Introduction
If you are going for a .NET interview, you may want to read these .NET interview questions and their answers.
1. What is the sequence of execution of the ASP.NET page life cycle?
The simple way is to remember SILVER.
- S (It is not counted)
- I (Init)
- L (Load)
- V (Validate)
- E (Event)
- R (Render)
Read more here.
2. What is the difference between a Hash Table and a Dictionary?
The main differences are listed below.
Dictionary,
- Returns an error if the key does not exist
- No boxing and unboxing
- Faster than a Hash table
Hashtable,
- Returns NULL even if the key does not exist
- Requires boxing and unboxing
- Slower than a Dictionary
3. How to use View state?
string str = "Sibeesh Passion";
if(ViewState["SampleText"]==null)
{
ViewState["SampleText"] = str;
}4. What are the state management techniques used in .NET?
Client-side
- Hidden Field
- View State
- Cookies
- Control State
- Query Strings
Server-side
- Session
- In Proc mode
- State Server mode
- SQL Server mode
- Custom mode
- Application.
Read here.
5. How can we create a new table in SQL with only the structure?
Here is the query to do that.
Select * Into<B>From<A>Where1 = 2
Points to be noted:
- A is the source table.
- B is the destination table.
- Condition 1=2 is to prevent the data from being copied.
6. How to add a button dynamically to a grid view?
Button myButton = newButton();
myButton.Text = "Hai";
myGrid.Controls.Add(myButton);7. How to find a control inside a GridView?
Button btnTest = (Button) myGrid.Rows[0].Cells[1].Controls[1].FindControl("myButton ");Here we are finding the control myButton from the 0th row first cell.
8. What are abstract and interface? Provide actual examples.
Please read here.
9. What is a partial class?
There are the following situations when splitting a class definition is desirable:
- To work with large projects.
- To split the class definitions as we needed with the keyword partial.
10. How to use a partial class?
public partial class DailyExpenses
{
To make it more real, let us consider this class is used by the Husband .
He will add his expenses (in programming life , his codes )
public void AddExpensesByHus()
{
}
}
public partial class DailyExpenses
{
To make it more real, let us consider this class is used by the Wife.
She will add his expenses (in programming life , her codes )
public void AddExpensesByWife()
{
}
}11. How to remove a constraint from a table in SQL Server?
ALTER TABLE MyTab DROP CONSTRAINT myConstraint12. How to create Table Variables In T-SQL?
Normally the syntax to create a table variable is the same as to create a table statement.
DECLARE@tabVar TABLE
(
Your fields here
)13. How can you delete a duplicate record from a table in SQL?
There are so many ways to do this. Here I am sharing what I use when I get that kind of situation.
I will create a temp table.
Copy the distinct data from the existing table to the temp table.
Empty the data in the existing table.
Insert the data from the temp table into the source table.
Here is the query to do that:
select distinct * into #tempTab From Address_Tab
delete from Address_Tab
insert into Address_Tab
select * from # tempTab
drop table # tempTab14. When to use an override and new in C#?
- We can use override when there is a virtual/abstract/override type of method in a base class.
- We can use New when there is no virtual/abstract/override type of method in a base class.
Next readings:


TejaswiniPosted Jul 4, 2024, 5:45 AM EDT
Great Post!
sandip kadamPosted Mar 12, 2020, 1:55 AM EDT
Nice !! helpful for interview
Ravi PatelPosted May 19, 2019, 11:44 PM EDT
Nice one thanks
saqib khanPosted Oct 5, 2018, 7:48 PM EDT
Lub u for sharing your knowledge with us
Danish ShaikhPosted Apr 19, 2018, 7:23 PM EDT
SILVER. = S for Start of request we can though .just a thought
Amol KumbhkarnaPosted Feb 14, 2018, 9:02 PM EST
Very useful thanks for sharing....
Sibeesh VenuTOP 100Posted Jan 5, 2017, 7:56 PM EST
Rakesh Ranjan Thanks much for your feedback.
Sibeesh VenuTOP 100Posted Jan 5, 2017, 7:56 PM EST
Subash Thanks much for your feedback.
Rakesh RanjanPosted Jan 5, 2017, 8:04 AM EST
Heartly Thanx for sharing this
SubashPosted Aug 17, 2016, 9:02 AM EDT
Thanks for share
Sibeesh VenuTOP 100Posted May 4, 2016, 9:00 AM EDT
Vivek Kumar Thanks
Sibeesh VenuTOP 100Posted May 4, 2016, 9:00 AM EDT
Sr Karthiga Thanks
Vivek KumarPosted Apr 20, 2016, 1:31 AM EDT
Good one
Sr KarthigaPosted Feb 23, 2016, 2:45 PM EST
good one
Sr KarthigaPosted Feb 23, 2016, 2:44 PM EST
Nice explanation
Sibeesh VenuTOP 100Posted Feb 3, 2016, 10:56 PM EST
amit singh Thank you
Sibeesh VenuTOP 100Posted Feb 3, 2016, 10:56 PM EST
Arul R Thank you
Amit Kumar SinghPosted Feb 3, 2016, 10:42 PM EST
Thanks for Article
Arul RPosted Jan 17, 2016, 6:01 AM EST
Thanks for nice article
Sibeesh VenuTOP 100Posted Jan 10, 2016, 5:55 PM EST
Prakash Tripathi Thank you
Prakash TripathiTOP 100Posted Jan 8, 2016, 7:58 PM EST
Good one.
Sibeesh VenuTOP 100Posted Dec 23, 2015, 6:16 PM EST
Santhakumar Munuswamy Thank you
Santhakumar MunuswamyPosted Dec 23, 2015, 10:45 AM EST
Thanks for nice article
Sibeesh VenuTOP 100Posted Dec 20, 2015, 8:35 PM EST
Rupali Shinde Thank you
Rupali ShindePosted Oct 22, 2015, 8:08 PM EDT
just awesome article :)
Sibeesh VenuTOP 100Posted Oct 7, 2015, 12:43 AM EDT
Nikhil G Thanks a lot
Nikhil GPosted Oct 7, 2015, 12:06 AM EDT
Super Like
Sibeesh VenuTOP 100Posted Sep 26, 2015, 1:20 AM EDT
Ajeet Mishra Thanks buddy
Ajeet MishraPosted Sep 26, 2015, 1:17 AM EDT
very nice
Sibeesh VenuTOP 100Posted Sep 22, 2015, 6:30 AM EDT
Upendra Pratap Shahi :) I will work on it buddy.
Upendra Pratap ShahiPosted Sep 22, 2015, 4:55 AM EDT
next link sir...
Sibeesh VenuTOP 100Posted Aug 10, 2015, 3:21 AM EDT
Upendra Pratap Shahi Thank you Buddy
Upendra Pratap ShahiPosted Aug 10, 2015, 2:43 AM EDT
great blast sir...
Sibeesh VenuTOP 100Posted Jul 16, 2015, 9:22 PM EDT
Prakash Tripathi Thank you
Sibeesh VenuTOP 100Posted Jul 16, 2015, 9:22 PM EDT
Amik Shukla Welcome. Thank you
Prakash TripathiTOP 100Posted Jul 16, 2015, 9:04 PM EDT
Good refresher
Amik ShuklaPosted Jul 10, 2015, 2:04 AM EDT
Thanks you Sir!
Sibeesh VenuTOP 100Posted Jun 23, 2015, 5:59 PM EDT
Amol Sarkate Thank you :)
Amol SarkatePosted Jun 23, 2015, 9:21 AM EDT
nice
Sibeesh VenuTOP 100Posted Jun 9, 2015, 7:30 AM EDT
Jagadish Palanivelu Thank you :)
Sibeesh VenuTOP 100Posted Jun 9, 2015, 7:30 AM EDT
Sumit Jolly Thank you :)
Jagadish PalaniveluPosted Jun 9, 2015, 4:22 AM EDT
Neatly Explained...
Guest UserPosted Feb 5, 2015, 9:03 PM EST
I liked clear difference b/w Hash Table and a Dictionary
Sibeesh VenuTOP 100Posted Feb 5, 2015, 6:21 PM EST
Nimit Joshi Thank you dude.
Nimit JoshiTOP 100Posted Feb 5, 2015, 6:01 PM EST
Excellent..
Sibeesh VenuTOP 100Posted Feb 5, 2015, 3:40 AM EST
Manish Kumar Choudhary Thanks a lot :)
Sibeesh VenuTOP 100Posted Feb 5, 2015, 3:40 AM EST
Viipiin Tyagi Thanks a lot :)
Manish Kumar ChoudharyPosted Feb 5, 2015, 2:06 AM EST
Nice one. similar question i also got in interview many time.
Vipin TyagiPosted Feb 5, 2015, 12:50 AM EST
good series....I faced many intervew and these questions are there...
Sibeesh VenuTOP 100Posted Feb 4, 2015, 11:00 PM EST
ani Sure . Thank you . I will try to write .
AniPosted Feb 4, 2015, 9:39 PM EST
Thanks for sharing your knowledge... could you please add questions regarding exception handling, polymorphism, collections and grid view functionality
Sibeesh VenuTOP 100Posted Jan 24, 2015, 6:31 AM EST
Abhishek Yadav Thank you :)
Abhishek YadavPosted Jan 24, 2015, 6:10 AM EST
Fantastic.... Thanx for sharing these questions.. :)