I'm trying to do something similar in Entity Framework, that I'm very used to doing in Linq-To-Sql. Now my question is if EF has the same capability, that I'm unable to figure out.
Linq-To-Sql:
dataContext.GetTable<T>();
Would yield a Queryable collection of type 'T'.
In Entity Framework I would like to do the same:
//NOTICE: T...
I've got a class public class foubar : fou
fou has its properties and so does foubar
I've created an instance of foubar and set values to all the properties including the base classes'.
Now I need an instance of fou that has the property values that are in foubar.
True, I could create a new instance of fou and write code that would popu...
I try to use SQL Server Compact Edition with Entity Framework in Visual Studio 2008 SP1. Here's what I do:
1) I create a new project, of type Console Application.
2) I right-click on the project, select Add->New Item.
3) I choose to add a Local Database called Something.sdf
4) In the next page of the "Add New Item" wizard, I choose t...
First off I'm a noob so please be gentle :-) I have a base object Company. I want to inherit this into a Customer object and a Vendor object. My problem starts with the fact that a given company can be a customer and a vendor at the same time. All the examples I have seen a use a property of the company and set it to either customer or v...
In Linq to SQL, I can't find an easy way to deal with multiple result sets returned by a stored procedure where each result set is from table joins. Each result set does not map directly to a table. (can't change this behavior). For now, it seems using a DataSet is a lot simpler.
Can the current Entity Framework or the upcoming one, 4.0...
I am currently transitioning an application over from LINQ-to-SQL and I've been running into a problem.
LINQ-to-SQL offered a way to query any Table/Column-attributed type (which was the default mapping model) through any DataContext through the GetTable<T> function, which analyzed the type and then created the appropriate SQL. Even th...
I am loading a graph of related entities from the database using ADO.NET MVC and the Entity Framework. One of the entities needs to be modified in memory, but not have changes persisted back to the database when other entities in the graph are changed.
At this time I have attempted to use the MergeOption.NoTracking and the MergeOption.O...
2 part question:
1st
What is the best way to setup a table/relationship structure given the following scenario: I have many tables that store different kinds of data (ie: books, movies, magazine - each as different tables) and then one table that stores reviews that can link to any of the table types. So a row in the review table can ...
I have the following code:
var devices = from d in ctx.Devices.Include("DeviceGroups")
where d.DeviceEnabled == true
select d;
dlTerminals.DataSource = devices;
On the front end i do the following:
<asp:DataList ID="dlTerminals" runat="server" DataKeyField="DeviceId" GridLines="None" RepeatColumns="2" RepeatDirection="Horizon...
This thing is driving me crazy, and the error is quite meaningless to me:
Unable to update the EntitySet 'TableB' because it has a DefiningQuery and no element exists in the element to support the current operation.
My tables are put like this:
TableA
int idA (identity, primary key)
...
TableB
int idA (FK for TableA.idA)
int val
...
I have a working web site using Linq to Entities, on a MySQL database. Last night I installed the MySQL connector 6.0 for .NET, and all was good on my local machine. I assume I now have some GAC to Bin migration to do on the host. Does anybody know what files I must transfer and what I must do to my web.config?
...
Suppose I have project MyData, then I add MyDb.edmx with EF wizard. In My database, I have table Person. Then I will get an entity Person in EF model.
Then I want to extend this Person by partial class in a separated file person.cs like:
namespace MyData
{
public partial class Person
{
[DataMember]
public int ...
I'm working with an SQL Server database with about 50 tables and plenty of relationships between those tables. I have already written a backup and restore function which will retrieve all data from the model, export it to XML which it could then import again into a clean database. But maintaining this import/export is a lot of work when ...
IBM Cognos TM1 is a multidimensional database that my company thinks is the latest and greatest. I've been to the classes and, sure, it is nice for analysis. Of course the finance people in my company only see the Excel Add-In or Excel-like website and think "that's all I need for a data entry application!" My response is "I thought you ...
Please read my question carefully and reply me.
I have two tables as table1 and table2.
In table1 i have columns as AddressID(Primary Key),Address1,Address2,City
In table2 i have columns as ContactID(Primary Key),AddressID(Foriegn Key),Last Name,First Name.
By using join operation i can retrive data from both the tables.
I created a...
I am using the .Skip and .Take methods with Entity Framework. The .Skip call is being honored when generating the SQL. The .Take is not. This code:
public IList<DocPullRun> GetDocRunsPaginated(int startRowIndex, int maximumRows) {
Logger.Debug("GetDocRunsPaginated: startRowIndex: {0}, maximumRows: {1}", startRowIndex...
I have a 3rd party database where the primary key is a char datatype. When I run my query, I use an include to include the child table. The count is zero though. I look at sql profiler and results are returned. The only thing I can see is an issue with the relationship columns being char. Any solution for this?
...
We have application where there is a layer between entities which provides relationship.
Chair -> RelationTable -> Legs
(In Chair)So Chair id # 1234
(In RelationTable)In RelationTable 1234 -> 1, 1234 -> 2, 1234 -> 4
(In Legs)Leg id #1, Leg id #2, Leg id # 4
Now i am looking into implementing EF4 as they have POCO.
Is it possible to...
Hi everyone,
I'm having a little trouble with my Entity add functionality.
Setup
For simplicity, I have in DB with 4 tables, Customer, Address, Area, Location.
Customer stores basic customer details ie. Id, Name, Username, Password, etc.
Address stores street name, street number, etc.
Area stores area name and area code.
Location st...
I installed the beta 2 of Visual Studio 2010 today. I went to test out the new entity framework stuff (to see if my "issues" from v1 were fixed.).
I started adding a new connection string, but when i put in my information for sql 2000 it said "this server version is not supported. you must have Microsoft sql server 2005 or later.". Did...