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.

Delete<br />

Deletes the specified row from “DataView” object.<br />

(B) What’s difference between “DataSet” and “DataReader”<br />

?<br />

Twist :- Why is DataSet slower than DataReader ?<br />

Fourth point is the answer to the twist.<br />

Note:- This is my best question and i expect everyone to answer it.It’s asked almost 99% in<br />

all companies....Basic very Basic cram it.<br />

Following are the major difference between “DataSet” and “DataReader” :-<br />

√<br />

√<br />

√<br />

√<br />

“DataSet” is a disconnected architecture , while “DataReader” has live<br />

connection while reading data.So if we want to cache data and pass to a<br />

different tier “DataSet” forms the best choice and it has decent XML support.<br />

When application needs to access data from more than one table “DataSet”<br />

forms the best choice.<br />

If we need to move back while reading record’s , “datareader” does not support<br />

this functionality.<br />

But one of the biggest drawbacks of DataSet is speed.As “DataSet” carry<br />

considerable overhead because of relations,multiple tables etc speed is slower<br />

than “DataReader”.Always try to use “DataReader” whereever possible. , as<br />

it’s meant specially for speed performance.<br />

(B) How can we load multiple tables in a DataSet ?<br />

objCommand.CommandText = "Table1"<br />

objDataAdapter.Fill(objDataSet, "Table1")<br />

objCommand.CommandText = "Table2"<br />

objDataAdapter.Fill(objDataSet, "Table2")<br />

Above is a sample code which shows how to load multiple “DataTable” object’s in one<br />

“DataSet” object.Sample code shows two tables “Table1” and “Table2” in object<br />

ObjDataSet.<br />

189

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

Saved successfully!

Ooh no, something went wrong!