473,473 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Entity Framwork repeats the same results

29 New Member
Hi
I have used Linq to SQL for a long time, but now, because I need to work with MySQL I had to start with Entity FrameWork.
I combine ADO.NET and EF and I did not realize about this issue, but recently, I had found a very big problem that it`s driving me crazy.

A simple query...

Dim Query = (From p in db.products select p).ToList

It gives the results the first time good, but when I run this query again, it gives the SAME RESULTS again and again !!!

I mean, any change in the database it is not reflected in that query. The only way is to quit program and run again.

Visual Basic - VS2013
Entity Framework 5.0 (MySql)

Thanks.
Nov 11 '15 #1
2 1600
Ammarhassan48
3 New Member
There might some mistake in your logic . Can you show the piece of code that is not working ?
Nov 12 '15 #2
LeoVBNET
29 New Member
Hi
The mystery has been solved:

EF caches the database. So, it is very important to make a context when needed and then dispose it.

Expand|Select|Wrap|Line Numbers
  1. Using DBEntity As New DBEntityModel()
  2.    ....
  3.     ....
  4. End Using
  5.  
Thanks!
Nov 12 '15 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Rodrigo | last post by:
Hi all, I created a script that query a Database in mysql. Everything goes right except the fact that the results for various queries are the same. I use $sth->finish() and $dbh->disconnect()...
1
by: google | last post by:
It would seem that when I assign an HTML entity to a form text input using "inline" javascript that it will display properly. But when trying to set it via a function call, the entity text shows...
6
by: C Albrecht | last post by:
When our users run reports, they don't always produce the same results, even though the data has not changed. We have several large reports containing several subreports. Users can run the report...
1
by: MLH | last post by:
if DLookup("", "tblAddressesEquifax", "=GetCurrentMemberID()") then ? "Hello" #AND# if not DLookup("", "tblAddressesEquifax", "=GetCurrentMemberID()") then ? "Hello" both result in "Hello"...
11
by: Arsen Vladimirskiy | last post by:
Hello, If I have a few simple classes to represent Entities such as Customers and Orders. What is the proper way to pass information to the Data Access Layer? 1) Pass the actual ENTITY to...
10
by: ja | last post by:
hi, i have problems with converting entities to chars, i'm using function: function entityToString (htmlString){ htmlString = htmlString.replace(/(&)(#)(\d{1,})(;)/g, function...
18
by: R. P. | last post by:
I wonder how to indicate in a stylesheet that character entities in an element are not to be transformed as would be the case in XML-to-XML transforms. I want to keep those & " and other character...
0
by: Mythran | last post by:
I would like to use the Regular Expression search in the Find dialog in VS.Net to find a pattern in a code file. I am not sure if a pattern can be written for the Find dialog that matches my...
5
by: ArchMichael | last post by:
i created database where it captures my team results but i need the database to search to see it item has passed twice consetuvicely and go to next level of test. example of test results item ...
2
by: Jerry W | last post by:
I'm using the following style #Wrapper { left: 0px; position: absolute; margin-left: 465px; width: 280px; top:455px; }
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.