myques ado.net

Upload: abhishek-kumar

Post on 03-Jun-2018

220 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/12/2019 MyQues Ado.net

    1/5

    1.What is typed dataset?Ans: Is a class that derives from a DataSet and provides strongly typed method, events andproperties. Additionally strongly typed data set provides access to values as the correct type atcompile time.

    2. What does the ExecuteScalar() method?Ans: ExecuteScalar returns first column of first row from result set.

    3. How do you delete row using dataset?Ans: By calling Delete! method on given row

    4. How do you handle inary large o!ects in "ata#eader?Ans: Binary large o"#ects are stored in dataset as array of "ytes

    $.What classes can you use to process %&' data in memory?Ans: $mlDocument, $%athDocument, $%ath&avigator and 'I&( to $)'

    . How can you call stored procedure rom c* code?Ans: By calling it using S*l+ommand o"#ect

    +. How do you ind what changes was done to the data set?By calling GetChanges() method

    ,. What is the dierence etween Execute-onuery and /eginExecute-onuery?

    Execute non *uery "loc the program till the *uery will "e processed and result returned.BeginExecute&on(uery initiates asynchronous operation.

    0. How do you create dataset o!ect and populate it with data rom c* code?

    Ans : DataSet ds - new DataSet!

    ds./a"les.Addnew Data/a"le!!

    ds./a"les012.+olumns.Add3col45!ds./a"les012.6ows.Addds./a"les012.&ew6ow!!

    1 What is S technology?

    Ans : )ultiple Active 6esults Sets. It7s a technology that allow applications to maintain multiple activestatements on a connection.

    11.How do use ommand/uilder class?

    Ans: +ommandBuilder o"#ects generates I&SE6/, 8%DA/E, DE'E/E statements for a Data/a"le"ased on Select *uery. 9ou create +ommandBuilder with data adapter o"#ect with filled Select

    +ommand. After that you can call et8pdated+ommand!, etDelete+ommand!

    12. How can you access children o %ml-ode?

    Ans: By using Item03node name52 property or +hild&odes collection

    13. How do you chec5 i connection to S' ser6er is open?

    Ans: By using +onnectionState property

    14. How do you ind what changes was done to the data set?

    Ans : By calling et+hanges! method

  • 8/12/2019 MyQues Ado.net

    2/5

    1$. How do you re!ect changes made to data set?

    Ans: "y calling 6e#ect+hanges method

    1. 7s it possile to use single code to wor5 with dierent data pro6iders?

    Ans: 9es. By using ID"+onnection, ID"+ommandyou can create command o"#ect using

    ID"+onnection.+reate+ommand! method!, IDataAdapter,IData6eader and ID"/ransaction1+. How do you chec5 numer o rows aected y update 8uery?

    Ans: Execute&on(uery )ethod on S*l+ommand returns num"er of rows affected.

    1,. an you seriali9e dataset instance?

    Ans :; 9es

    10. :o what type ntext type will e mapped in c* code?

    Ans: S*l/ypes.S*lString

    2. How can you ill data set with multiple tales?

    Ans: %rovide two or more *ueries separated "y to S*lDataAdapter and use it to fill dataset.21. What class should you use %sl:ransorm or %slompiled:ransorm or %S'transormations?

    Ans: $sl/ransform is newer, faster and have more options and should "e used

    22. an you edit %&' data using %;ath-a6igator created rom %&'"ocument class?

    Ans: 9es

    23. How do you use '7- to S'?

    Data+ontext d" - new Data+ontext3connection string5!

    /a"le

  • 8/12/2019 MyQues Ado.net

    3/5

    the resulting row set within the data"ase, allowing the rows to "e retrieved.

    ! ExecuteScalar:Executes the S(' *uery or Stored %rocedure and returns only single value effectively the first columnof the first row of the resulting row set any other returned columns and rows are discarded!.

    2,. What are the 6arious methods pro6ided y the dataset o!ect to generate %&'?

    Ans: DataSet o"#ect provides following methods to generate $)':

    4! 6ead$)'6eads a $)' schema and data in to Dataset.

    @! =rite$)'=rites data, and optionally the schema, from the DataSet into an $)' file and saves it to dis.

    ! et$)'It returns an $)' string that is a representation of the data stored in the DataSet. et$ml returns $)'as a string, so it re*uires more overhead than =rite$ml to write $)' to a file.

    20. Explain the 6arious steps in6ol6ed to ill a dataset?

    Step;4:

  • 8/12/2019 MyQues Ado.net

    4/5

    ?ollowing code snippet is used to do the same:

    o"#Data6eader - o"#+ommand.Execute6eader +ommandBehavior.+lose+onnection!

    31. What is the dierence etween "ataSet and "ata#eader?

    Ans: ?ollowing are some ma#or differences "etween DataSet and Data6eader:

    4! Data6eader provides forward;only, read;only access to data, while the DataSet o"#ect can holdmore than one ta"le from the same data source as well as the relationships "etween them.

    @! DataSet is a disconnected architecture while Data6eader is connected architecture.

    ! DataSet can persist contents while Data6eader cannot persist contents, they are forward only.

    32. What are the ad6antages o "

  • 8/12/2019 MyQues Ado.net

    5/5