Buy Questpond's video subscriptions on
huge discount
.
Online: 1910
Home
Articles
Interviews
Forums
For Beginners
Popular Questions
ITIL Career Advice
PMP Career Advice
Career Advices
Codes
Videos
ASP.NET
ASP.NET MVC
Android Intel XDK
Sql Server
AngularJS
Bootstrap
Backbone.JS
MongoDB
LESS (CSS)
jQuery
WPF
WWF
SSIS
LightSwitch
Tutorials
News
ASP.NET MVC
|
Be Interview Ready
|
Top Performers
|
DNF MVP
|
Top Posts
|
Winners
|
Subscribe
|
Catalogs
Welcome Guest !
Register
Login
Home
>
Interviews
> ADO.NET
ADO.NET Interview Questions and Answers (445) - Page 16
Latest and authentic Interview questions. You can also
post an interview question
and
win monthly prizes
as well as gain community
credit points
.
445 records found.
Post
|
Interview Experiences
|
Interview FAQs
|
Online Interviews
|
Exclusive Questions
Get 650+ Questpond's Interview videos on discount
Loading ...
You use DataContext to execute a query on a database. Your code modifies returned objects. You need to submit all changes and handle any conflicts. What should you do
NOTE: This is objective type question, Please click question title for correct answer.
You are implementing ASP.NET Web service methods named GetEmployees and UpdateEmployees. GetEmployees uses LINQ to SQL to return an employees result set. UpdateEmployees updates the database with changes made to the employees result set. In UpdateEmployees, you create a DataContext. You must add code to associate the modified result set with this DataContext instance and submit changes to the database. Your solution should use a minimum of developer effort. What should you do?
NOTE: This is objective type question, Please click question title for correct answer.
You use DataContext to execute a LINQ query to return a database table. This table includes a column named LastProcessed. You must modify the column mapping to ensure that this column is not compared in conflict checking. What should you do?
NOTE: This is objective type question, Please click question title for correct answer.
Your application uses the following code to update a database using a strongly typed DataContext: Customer cust = new Customer { CustomerID = "CONTO", CompanyName = "Contoso" }; db.Customers.InsertOnSubmit(cust); db.SubmitChanges(); You must detect whether the update conflicts with changes made to the database since the query was made. What should you do?
NOTE: This is objective type question, Please click question title for correct answer.
Your application uses the following code to submit changes to a database using a strongly typed DataContext named db: try { db.SubmitChanges(ConflictMode.ContinueOnConflict); } catch (ChangeConflictException e) { Console.WriteLine(e.Message); foreach (ObjectChangeConflict occ in db.ChangeConflicts) { // Overwrite values } } You must add code to resolve conflicts such that: * Original property values of changed properties must not be overwritten with values received from the database. * Client changes to properties must be preserved. What should you do?
NOTE: This is objective type question, Please click question title for correct answer.
You are developing a smart client application. Your code uses a strongly typed DataContext named db to work with a customer table. You use the following code to add a new customer and refresh a data grid with all customers in the table by calling the LoadCustomers method: Customer cust = new Customer { CustomerID = customerIDToAdd, CompanyName = customerNameToAdd }; db.Customers.InsertOnSubmit(cust); LoadCustomers(db.Customers); You find that the newly added customer does not show in the list. You must fix the problem. What should you do?
NOTE: This is objective type question, Please click question title for correct answer.
You add code that modifies Entity Framework entities. You need to use the ObjectContext to save changes to the database. All changes must be saved within a single transaction, and your solution should require minimal effort. What should you do?
NOTE: This is objective type question, Please click question title for correct answer.
You add code that modifies Entity Framework POCO entities with proxies. You need to create a POCO entity named Customer and ensure that it will be inserted when you call the SaveChanges method of the ObjectContext. What should you do?
NOTE: This is objective type question, Please click question title for correct answer.
You are implementing an Entity Framework application. A method retrieves and modifies Entity Framework entities. You need to persist all updates to the data source. What should you do?
NOTE: This is objective type question, Please click question title for correct answer.
You are implementing a method that uses Entity Framework-generated entities. This method creates a new Product entity. You need to associate the Product with a parent Supplier entity and ensure that the Product entity is inserted when you call the ObjectContext's SaveChanges method to persist changes. What should you do?
NOTE: This is objective type question, Please click question title for correct answer.
You are implementing a method named DeleteProduct. This method first retrieves an Entity Framework-generated entity with a given key. You need to add code to ensure that the Product entity is deleted from the data source when you call the ObjectContext's SaveChanges method. What should you do?
NOTE: This is objective type question, Please click question title for correct answer.
You are implementing a method that uses Entity Framework POCO entities. This method creates a new Product entity and proxy by using the ObjectContext's CreateObject method. You need to ensure that the Product is added to the data source when you call the ObjectContext's SaveChanges method. What should you do?
NOTE: This is objective type question, Please click question title for correct answer.
You are implementing a method that uses Entity Framework POCO entities that do not support proxies. This method retrieves a Product entity and changes its Status property. You need to ensure that the ObjectStateManager tracks this change so that the data source can be updated. Which ObjectContext method should you call?
NOTE: This is objective type question, Please click question title for correct answer.
You define an Entity Data Model that maps the insert, update, and delete operations of the Product entity type to stored procedures. You create a method that retrieves a Product entity and changes its Status property. You need to update the data source, ensuring that the stored procedure mapped to the update operation is called. What should you do?
NOTE: This is objective type question, Please click question title for correct answer.
You are implementing an application that uses Entity Framework-generated entities to update a data source. You add a method that retrieves a Product entity and changes its Status property. You need to ensure that the Entity Framework will throw an exception if a value in the data source changes between the time that your method retrieves the Product and the time the Product saves changes to it. What should you do?
NOTE: This is objective type question, Please click question title for correct answer.
You are implementing an application that uses Entity Framework-generated entities to update a data source. You add a method that retrieves a Product entity, modifies it, and then calls the ObjectContext's SaveChanges method. You configure the Entity Data Model to check for concurrency before updating the data source. You need to log the error if the data source cannot be updated because the concurrency check fails. What should you do?
NOTE: This is objective type question, Please click question title for correct answer.
You are implementing an application that uses Entity Framework-generated entities to update a data source. To prevent an optimistic concurrency violation, you need to ensure that the object context includes all data source changes before you call the SaveChanges method. What should you do?
NOTE: This is objective type question, Please click question title for correct answer.
You are writing an application that accesses a single Microsoft SQL Server database. You must use transactions to ensure consistency between two of the database tables. You must choose the transaction type with the least impact on performance. What should you do?
NOTE: This is objective type question, Please click question title for correct answer.
You are writing a component that uses a TransactionScope to ensure transactional behavior. You must add code to call an Enterprise Services component. This component uses Enterprise Services declarative transactions. You must combine the System.EnterpriseServices transactions with the ambient transaction created by the TransactionScope block. What should you do?
NOTE: This is objective type question, Please click question title for correct answer.
You add a method that updates tables with two update commands. These commands execute within a TransactionScope using block to ensure that these commands either both complete or both fail. You want to ensure that the completion status of these commands does not affect any transactions started before the method was called. What should you do?
NOTE: This is objective type question, Please click question title for correct answer.
1
...
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
More ADO.NET Exclusive Interview Questions & Answers here
Found this useful, bookmark this page to the blog or social networking websites.
Bookmark It
Interview Questions and Answers Categories
.NET Certifications
.NET Core
.NET Framework
ADO.NET
AI ML
Android
Angular
AngularJS 1x
Aptitute Test
ASP.NET
ASP.NET AJAX
ASP.NET Core
ASP.NET MVC
ASP.NET Web API
Aurelia
Azure
Best Practices
BizTalk Server
Bootstrap
C#
Cloud
CMS
CSS 3
Data Structures & Algorithms
Design Pattern & Practices
DotNetFunda.Com
Entity Framework
Error and Solution
F#
Function Points (FPA)
HR
HTML 5
IIS
Interview Questions
JavaScript
jQuery
Kinect
LightSwitch
LINQ
Management
Mobile Development
MSBI (SSIS, SSRS, SSAS)
Mule
Networking
News and Community
Node.js
NoSql
OOPS
Oracle
Others
PostgreSQL
PowerShell
Product Reviews
Project Management
Python
QA (Testing)
R Language
Regular Expressions
SEO
SharePoint
SignalR
Silverlight
Sql Server
TypeScript
UML
VB.NET
Visual Studio
WCF
Web Analytics
Web Services, Remoting
Windows 8
Windows Forms
Windows Metro
Windows Phone
WPF
WWF
XML