I've noticed that if i have an Pk/FK association, the FK ID is removed from the entity in the designer. How do I join query statements?
Basically I'm looking for some good Linq to Entity video tutorials (sorry, I'm an audio/visual learner)
...
I am using LINQ to EF and have the following LINQ query:
var results = (from x in ctx.Items
group x by x.Year into decades
orderby decades.Count() descending
select new { Decade = decades.Key, DecadeCount = decades.Count() });
So this kind of gets me to where I want to be, in that I get the...
When I have tables in my database that have PK/FK relationships (int) and when they are modeled by the Entity Framework designer everything seems as it should be. I can write the code below and everything seems like it's going to work fine as well but then when I run the code I get an error on the project.Status.StatusName saying the Ob...
I am trying to extend the partial classes that the entity framework creates so that I can more easily work with objects like in the code below (please let me know if there's a better or more exceptable way of doing this with the entity framework)
Public Sub New(ByVal ProjectID As Integer)
Dim proj As Project = (From p In db....
I have got a field with data type int? price and allow null, when I set
book.price = null;
and update, it is not saved and does not throw any exceptions, when I change value # null, it is ok. I want set it null, plz help.
...
Let's say I have a table called Product, with three columns: Id, CustomerId, Name. Id is the primary key. The schema is outside of the control of my group, and we now have a requirement to always provide CustomerId as a parameter for all queries (selects, updates, deletes). It's a long story I'd rather not get into ... it involves trig...
There was a library of dynamic Linq extensions methods released as a sample with VS2008. I'd like to extend it with a Join method. The code below fails with a parameter miss match exception at run time. Can anyone find the problem?
public static IQueryable Join(this IQueryable outer, IEnumerable inner,
string outerSelector, string in...
I've been investigating what data layer to use for a new web-based project I'm designing and I'm very keen to look at incorporating LINQ to SQL. Its apparent simplicity, flexibility and designer support really appeals and the implicit tie-in to SQL Server is fine.
However, it has been announced recently that LINQ to SQL will be taking a...
I'm confused about Linq to Entities. Is it the new name of Entity Framework or are they different things?
...
Hi,
Is there anyway I can create a not in clause like I would have in SQL Server in Linq to Entities?
Cheers
Paul
...
We are using L2E and REST in our project, and while I have been able to retrieve data from the db without issue, I am still not able to update or add new records to the db. I imagine that it's a syntax problem (we're still new to to linq), but I haven't been able to figure it out. We initially load the data in the dataservicecontext, a...
I heard lots of reviews on the book Linq in Action, but it does not cover Linq to Entities.
Please provide your feedback on the books you may have read.
...
I want to create a Blog object which has a relation between User. To create the relationship do I have to select User entity first, then set it to User property of Blog object? In Entity Framework samples suggest to set the User object to ViewState and retrieve it when you need to create the relationship, like a basic cache.
Is this ne...
Trying to get a handle on Entity Framework here and I am hitting some speedbumps...
I have a Get() method that works fine and has been tested, buut my Delete method is not working:
public static void Delete(string name)
{
J1Entities db = new J1Entities();
db.DeleteObject(Get(name));
db.SaveChanges();
}...
Some people want to see the DB structure and dont have VS, is there a way to do this? Or any other way to export it outside of a screencapture (it is a huge diagram).
Thank you.
...
I'd like the community's take on some thoughts I've had about Linq to Sql and other ORM mappers.
I like Linq to Sql and the idea of expressing data access logic (or CRUD operations in general) in your native development tongue rather than having to deal with the "impedance mismatch" between C# and SQL. For example, to return an ObjectD...
I'm looking to add an "advanced search" capability to my ASP.NET/SQL Server 2005 application. Ideally, I'd like it to be table driven. For example, if my schema changes with the addition of a new column to a table that I want to search, I'd like to have the UI reflect the addition of the new column as a searchable field. I can envisio...
I am quite sure I've seen the answer to this question somewhere, but as I couldn't find it with a couple of searches on SO or google, I ask it again anyway...
In Entity Framework, the only way to delete a data object seems to be
MyEntityModel ent = new MyEntityModel();
ent.DeleteObject(theObjectToDelete);
ent.SaveChanges();
However,...
I am trying to create a new instance of a Customer entity in our application, and I am having a few problems. This entity has several navigational properties, each of which has their own nav. properties. For example, each Customer entity has an Address entity, and each Address entity has a Phone Number entity etc. I haven't figured ou...
I'm using Linq2Entity for most of my database operations. However for database creation, table creation and initial data insertion I use plain SQL files. Therefore I need both an SqlConnection and an EntityConnection. Unfortunately the Entity Framework starts complaining that the Sql Server is not listening on the other end of the pipe. ...