Solved

Entity Framework and Linq queries

Posted on 2014-01-15
3
304 Views
Last Modified: 2016-02-10
Hi guys,

Ok this is a bit of a general question. We started using entity framework, dragging the tables across from the data source window (as grids) and letting EF do the binding. But this soon started getting messy with links and removing all auto generated code when removing grids etc. So I started to write Linq queries linking to EF and populating the grid with the Linq results.

Will we run into problems with this if 2 users fire the same query to the database at the same time or will EF manage this? in terms of saving data and returning a unique ID

My boss asked a valid question in that why are we using EF if its not doing the binding for us and why don't we go back to our own method of doing our own database connection, firing SQL queries, getting results and closing database connection?

I know this is an odd question but I was just looking for general advice and possibly your opinions on how you do things.
0
Comment
Question by:deanlee17
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
Imran Javed Zia earned 500 total points
ID: 39781929
Yes EF take cares of auto generated/identity fields in dbms like sql server and etc, but you may have to address them manually in dbms like oracle.

 
It all depends on your requirement, please refer to following general discussions:
http://www.bishoylabib.com/2012/01/why-entity-framework-is-better-than-ado.net
stackoverflow.com/questions/9811106/entity-framework-vs-ado-net
http://forums.asp.net/p/1686009/4441548.aspx?EF+Frustrations

Thanks
0
 

Author Comment

by:deanlee17
ID: 39782273
Great info in the links. Ok so if I had a scenario where I have 2 users uploading 10,000 records at once it would complete one users database inserts before moving on to the second user?
0
 
LVL 16

Expert Comment

by:Imran Javed Zia
ID: 39782373
As per my understanding, either you use ado.net or EF, in such scenario, you have to manually implement transactions or semaphore (lock statement) as per requirements.

Like if there is requirement that when 1st batch is in process then the 2nd batch may not execute in such case you may use semaphore, alternatively you may use transaction.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB.NET - Error - Object not set in Module 4 39
Sending receiving text messages in vb.net 15 48
Help with preventing selection from a combobox 11 34
Code enhancement 4 20
A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question