1.Which ADO.NET object is a forward only cursor and is connected to the database while the cursor...

Question:

1.Which ADO.NET object is a forward only cursor and is connected to the database while the cursor is open?
a.DBDataReader
b.DataSet
c.DataTable
d.DataAdapter
2.Which ADO.NET Command object's property would you use when a query returns the SUM of a column in a table?
a.ExecuteNonQuery
b.ExecuteDataReader
c.ExecuteScalar
d.Execute
3.Which ADO.NET object is a fully traversable cursor and is disconnected from the database?
a.DBDataReader
b.DataSet
c.DataTable
d.DataAdapter
4.Which method of a DataAdapter is used to populate a DataSet?
a.Populate
b.Fill
c.Load
d.DataSets[0].Fill
5.Which property of an ADO.NET DataAdapter is used to insert records in a database?
a.InsertText
b.InsertType
c.InsertCommand
d.InsertDataTable
6.Which ADO.NET Command object's property would you use when a query returns the SUM of a column in a table?
a.ExecuteNonQuery
b.ExecuteDataReader
c.ExecuteScalar
d.Execute
7.When using the ADO.NET Entity Framework you create a Model that represents the object in the database. What class does the Model inherit from?
a.DBContext
b.DBSet
c.Model
d.Connection
8.How are stored procedures represented in the ADO.NET Entity Framework?
a.A class is created with the same name as the stored procedure, and the Execute method is implemented.
b.A method is added to the Model that is the same name as the stored procedure.
c.Stored procedures cannot be called from the ADO.NET Entity Framework.
d.A method is created in the entity class for the table in the stored procedure.
9.Which code uses the ADO.NET Entity Framework to add a record to the database?
a. using (NorthwindsEntities db = new NorthwindsEntities())
{
Category category = new Category()
{
CategoryName = "Alcohol",
Description = "Happy Beverages"
};
db.Categories.Add(category);
db.SaveChanges();
}
b. using (NorthwindsEntities db = new NorthwindsEntities())
{
Category category = new Category()
{
CategoryName = "Alcohol",
Description = "Happy Beverages"
};
db.Categories.Add(category);
db.InsertRecords ();
}
c. using (NorthwindsEntities db = new NorthwindsEntities())
{
Category category = new Category()
{
CategoryName = "Alcohol",
Description = "Happy Beverages"
};
db.Categories.Insert (category);
db.SaveChanges();
}
d. using (NorthwindsEntities db = new NorthwindsEntities())
{
Category category = new Category()
{
CategoryName = "Alcohol",
Description = "Happy Beverages"
};
db.Categories.Insert(category);
db.InsertRecords();
}
10.Which code uses the ADO.NET Entity Framework to update a record in the database?
a. Category category = db.Categories.First(c => c.CategoryName == "Alcohol"); category.Description = "Happy People"; db.UpdateRecords ();
b. Category category = db.Categories.First(c => c.CategoryName == "Alcohol"); category.Description = "Happy People"; db.Categories.UpdateRecords();
c. Category category = db.Categories.First(c => c.CategoryName == "Alcohol"); category.Description = "Happy People"; db.SaveChanges();
d.Category category = db.Categories.First(c => c.CategoryName == "Alcohol"); category.Description = "Happy People"; db.Categories.SaveChanges();
Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  answer-question

Physics

ISBN: 978-1118486894

10th edition

Authors: David Young, Shane Stadler

Question Posted: