Questions in C#

1. What is the states available in

Client side state:

  • View State
  • Control State
  • Hidden fields
  • Cookies
  • Query Strings

Server side state :

  • Application State
  • Session State

2. What is static class ?

A static class should contain static members and fields . Static fields values wont change for the whole Application.

  • Static methods should be specific to the application, not for the specific user. We cant replace it for session.
  • Static methods object state doesn’t change.  so generally they will use static methods for retrieval operation. We wont use Insert, Update methods with static cos its state will change

Sql Query to Select


Take Particular Column :

 SELECT ColumnName From TableName

Take Particular Row From Table:

 SELECT * FROM TableName WHERE ColumName ='xyz'

 (Note: If the column is Interger u can directly pass the value if it is string means u can use single quotes )

Take Particular row and Column :

SELECT ColumnName FROM TableName WHERE ColumnName=x -- Note When x is integer

Dynamic Sql —

After u learn normal sql, Please go to practice for Dynamic sql. That will help to improve ur logics