Pages

Monday, 21 September 2015

Latest ADO.NET Interview Questions and Answers

21 :: Difference between SqlCommand and SqlCommandBuilder?
a) SQLCommand is used to execute all kind of SQL queries like DML(Insert, update,Delete) & DDL like(Create table, drop table etc)
b)SQLCommandBuilder object is used to build & execute SQL (DML) queries like select, insert, update & delete.

22 :: Why ca not we use Multiple inheritance and garbage collector paralelly in .net?
.net doesn't support the mutiple inheritance, perhaps you may talk about multi-level inheritance.

In the later case, if a class is inherited from another class, at the time of creating instance, it will obviously give a call to its base class constructor (ie bottom - top approach). Like wise the constructor execution is takes place in top down approach (ie. base class constructor is executed and the derived class constructor is executed).

So for GC, it will collect only when an object does not have any reference. As we see previously, the derived is constructed based on base class. There is a reference is set to be. Obviously GC cannot be collected.

23 :: How to find the given query is optimised one or not?
First Excute Sql Quries in Query Analzer,see How much time 2 take Excute , if Less then the ur desired Time, then it will Optimize query

24 :: How to copy the contents from one table to another table and how to delete the source table in ado.net?
it is possible

DataSet ds;

sqlAdap.Fill(ds);

Datatable dt = ds.Tables[0].copy();

//now the structure and data are copied into 'dt'

ds.Tables.remove(ds.Table[0]);

//now the source is removed from the 'ds'

25 :: How to call the SQL commands asynchronously in ADO.NET version 2.0?
executescalar()
executereader()
executenonquery()

these comes with Begin and End like Beginexecutescalr() Endexecutescalar().......

by using these command we can achieve asynch comm in ado.net

More Questions & Answers:-
Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8

No comments:

Post a Comment