Monday, 21 September 2015

ADO.NET Interview Questions and Answers for freshers pdf free download

6 :: Explain ExecuteNonQuery?
// Summary:

// Executes a Transact-SQL statement against the connection and returns the number of rows affected.

// Returns:

// The number of rows affected.

7 :: What is the ExecuteScalar method?
// Summary:

Executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.

// Returns:

The first column of the first row in the result set, or a null reference (Nothing in Visual Basic) if the result set is empty.

8 :: Which one of the following objects is a high-level abstraction of the Connection and Command objects in ADO.NET?
DataReader DataSet DataTable DataView DataAdapter

Answer: DataAdapter

9 :: How can we load multiple tables in to Dataset?
DataSet ds=new DataSet();

SqlDataAdapter dap=new SqlDataAdapter(Select * from <tablename>,<connection1>);


SqlDataAdapter dap1=new SqlDataAdapter(Select * from <tablename>,<connection1>);


10 :: What is connection String?
connection String - a string which contains address of the database we want to connect to.

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

No comments:

Post a Comment