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>);
dap.Fill(ds,"TableOne");
SqlDataAdapter dap1=new SqlDataAdapter(Select * from <tablename>,<connection1>);
dap1.Fill(ds,"tableTwo");
10 :: What is connection String?
connection String - a string which contains address of the database we want to connect to.
// 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>);
dap.Fill(ds,"TableOne");
SqlDataAdapter dap1=new SqlDataAdapter(Select * from <tablename>,<connection1>);
dap1.Fill(ds,"tableTwo");
10 :: What is connection String?
connection String - a string which contains address of the database we want to connect to.
No comments:
Post a Comment