26.02.2015 Views

DOT NET Interview Questions - DotNetSpider

DOT NET Interview Questions - DotNetSpider

DOT NET Interview Questions - DotNetSpider

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

objDataAdapter.SelectCommand = objCommand<br />

Third steps is to create the Adapter object and pass the command object to the adapter<br />

object.<br />

objDataAdapter.Fill(objDataSet)<br />

Fourth step is to load the dataset using the “Fill” method of the dataadapter.<br />

lstData.DataSource = objDataSet.Tables(0).DefaultView<br />

lstData.DisplayMember = “FirstName”<br />

lstData.ValueMember = “FirstName”<br />

Fifth step is to bind to the loaded dataset with the GUI.At this moment sample has<br />

listbox as the UI.Binding of the UI is done by using DefaultView of the dataset.Just to<br />

revise every dataset has tables and every table has views.In this sample we have only<br />

loaded one table i.e. Employees table so we are referring that with a index of zero.<br />

Just say all the five steps during interview and you will see the smile in the interviewer’s<br />

face.....Hmm and appointment letter in your hand.<br />

(B)What are the various methods provided by the dataset<br />

object to generate XML?<br />

√<br />

√<br />

√<br />

Note:- XML is one of the most important leap between classic ADO and ADO.<strong>NET</strong>.So<br />

this question is normally asked more generally how can we convert any data to XML<br />

format.Best answer is convert in to dataset and use the below methods.<br />

ReadXML<br />

Read’s a XML document in to Dataset.<br />

GetXML<br />

This is function’s which return’s a string containing XML document.<br />

WriteXML<br />

This write’s a XML data to disk.<br />

(B) How can we save all data from dataset ?<br />

186

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!