Answered Questions

  • ASP .Net Page Life Cycle

    Explain the life cycle of an ASP .NET page.

    Star Read Best Answer

    Editorial / Best Answer

    aanand_agrawal  

    • Member Since Apr-2009 | Apr 30th, 2009


    1. OnInit (Init) Initializes each child control of the current

    2. LoadControlState: Loads the ControlState of the control. To use this method, the control must call the Page.RegisterRequiresControlState method in the OnInit method of the control.

    3. LoadViewState: Loads the ViewState of the control.

    4. LoadPostData: Is defined on interface IPostBackDataHandler. Controls that implement this interface use this method to retrieve the incoming form data and update the control’s properties accordingly.

    5. Load (OnLoad): Allows actions that are common to every request to be placed here. Note that the control is stable at this time; it has been initialized and its state has been reconstructed.

    6. RaisePostDataChangedEvent: Is defined on the interface IPostBackData-Handler. Controls that implement this interface use this event to raise change events in response to the Postback data changing between the current Postback and the previous Postback. For example, if a TextBox has a TextChanged event and AutoPostback is turned off, clicking a button causes the Text-Changed event to execute in this stage before handling the click event of the button, which is raised in the next stage.

    7. RaisePostbackEvent: Handles the client-side event that caused the Postback to occur

    8. PreRender (OnPreRender): Allows last-minute changes to the control. This event takes place after all regular Post-back events have taken place. This event takes place before saving ViewState, so any changes made here are saved.

    9. SaveControlState: Saves the current control state to ViewState. After this stage, any changes to the control state are lost. To use this method, the control must call the Page.RegisterRequiresControlState method in the OnInit method of the control.

    10. SaveViewState: Saves the current data state of the control to ViewState. After this stage, any changes to the control data are lost.

    11. Render: Generates the client-side HTML, Dynamic Hypertext Markup Language (DHTML), and script that are necessary to properly display this control at the browser. In this stage, any changes to the control are not persisted into ViewState.

    12. Dispose: Accepts cleanup code. Releases any unman-aged resources in this stage. Unmanaged resources are resources that are not handled by the .NET common language runtime, such as file handles and database connections.

    13. UnLoad

    Abhijit

    • Apr 1st, 2015

    I wont go in detail but I can write down the sequence of execution.
    1) PreInit
    2) Init
    3) InitComplete
    4) PreLoad
    5) Load
    6) Controls Event (postback events of all controls on page)
    7) LoadComplete
    8) PreRender
    9) SaveSateComplete
    10) Render
    11) Unload



  • Difference between ado.net data set and ADO Record set

    Star Read Best Answer

    Editorial / Best Answer

    ramakrishnag1982  

    • Member Since Nov-2006 | Aug 12th, 2007


    1) A DataSet can represent an entire relational database in memory, complete with tables, relations, and views, A Recordset can not.

    2) A DataSet is designed to work without any continuing connection to the original data source; Recordset maintains the contentious connection with the original data source.

    3) There's no concept of cursor types in a DataSet, They are bulk loaded, while Recordset work with cursors and they are loaded on demand.

    4) DataSets have no current record pointer, you can use For Each loops to move through the data. Recordsets have pointers to move through them.

    Kishore

    • Jan 24th, 2013

    Please need some more related information about the each topic..It is not sufficient to answer in Interviews.

    sathin

    • Oct 29th, 2009

    To get the data from a database and put it on a data control In ADO they used recordset In ADO.Net they used dataset Record set is a connection oriented architecture whereas dataset supports a c...

  • what is .net frame work?

    The .NET Framework has two main components: the common language runtime and the .NET Framework class library.You can think of the runtime as an agent that manages code at execution time, providing core services such as memory management, thread management, and remoting, while also enforcing strict type safety and other forms of code accuracy that ensure security and robustness.The class library, is...

    sathin

    • Aug 25th, 2009

    .NET framework consists of
    1) CLR
    2) Class library
    3) ASP.Net
    CLR (Common Language Runtime): The name itself gives you an idea what CLR is.

    RUNTIME can be described as a reduced version of a program.  It enables you
    to Execute the program but not develop it.

    samiksc

    • Jan 11th, 2006

    .Net framework is an environment provided on top of the OS which looks into Memory managementThread managementand providesLanguage independencePlatform independenceIt is defined by Microsoft as '...

  • How to copy the contents from one table to another table and how to delete the source table in ado.net?

    Star Read Best Answer

    Editorial / Best Answer

    samiksc  

    • Member Since Oct-2005 | Jul 12th, 2007


    The question can mean 2 tasks -
    1. Copy one 'datatable' to another and delete the source 'datatable' OR
    2. Copy one database table (say a table in sql server database) to another database table, and delete the source table which is in the SQL server database. This operation is to be performed using ADO.Net

    Answers:
    1. DataTable newOne = originalOne.Copy(); originalOne.Dispose(); -- Note that originalOne.Clear() will simply delete all rows from the table, but the table object with its structure will remain there.
    2. Run DDL commands using 'ExecuteNonQuery' method of DataCommand object.
    e.g. string cmdText1 = "create table newOne as select * from originalOne" (copy table to another)
    string cmdText2 = "drop table originalOne";
    DataCommand dataCmd = new SqlDataCommand(cmdText1, conn);
    conn.Open();
    dataCmd.ExecuteNonQuery();
    dataCmd.CommandText = cmdText2;
    dataCmd.ExecuteNonQuery();
    conn.Close();

    sathin

    • Oct 29th, 2009

    This is definitely possible. I tried making it simple by talking two gridviews in the design part and writing the below code when you try creating a datatable do avoid the new keyword Imports S...