Hello,
In ADO.NET, ExecuteNonQuery() "For UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the command" (http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.executenonquery.aspx)
In EF v1, context.SaveChanges() method returns "The number of objects in an Added, Modified, or ...
Here’s a really really super-basic question.
Say I wanted to build – today – an enterprise CRUD application in .NET that had an n-tier architecture. What data access approach should I use? I want interoperability, so DataSets are out (and I suppose it’s not 2003 anymore, either). Likewise, .NET RIA Services’ advertised method of expo...
Hi All,
I am writting a new application using the Entity Framework.
Where would the EF lie? My current thinking is to issolate it in a DataAccess assembly that exposes a number of repositories (that essentially wrap EF).
I would then create my own Domain objects and pass them to the repository that maps them to an EntityFramework...
Hi,
I have an array of strings
var controlsToGet = new[] {"lblHome","lblContact"};
I have List<LanguageControl> and LanguageControl class holds Controls in it.
I want to get Controls from List which Control.Name == controlsToGet
I am looking for something like that
var all = fooelements.where(l=>l.Control.Name == controlsToGet);
...
I use Entity Framework and Linq to Entities. I want to encrypt the connection string and the EF has to decrypt automaticaly, How can I do it?
Thanks in advance,
Javier P. de Jorge
...
Suppose I have a couple of table:
person(personid, name, email)
employee(personid,cardno, departmentID) //personid,departmentID is foreign key
department(departmentID, departmentName)
employeePhone(personID, phoneID) //this is relationship table
phone(phoneID, phonenumer)
When EntityFramework generate entity class for employee, t...
Hi,
In my last project i decided to use Entity Framework and it was all going well until i try to get datas with "where in", i got an error.
After a tiny search i ve come up with this post and that post.
This is what i am trying to do
var all = fooelements
.Where(l=>controlsToGet
.Contains(l....
I'll try to keep this short and concise.
I got my controller here...
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Edit(CustomObject myCustomObject)
{
...
}
Where myCustomObject looks great. But, if I want to save this using the entity framework, I need to do something like this...
[AcceptVerbs(HttpVerbs.Post)]
public Acti...
I am looking for information on how people are handling business rule (and field validations) using an ADO.NET Data Service wrapped around an Entity Framework object context.
I have seen numerous posts/articles/etc that seem to be fine with just throwing an exception. I would prefer to have an object that contains a set of errors with ...
After hunting around the net, and thinking I'd come up with the solution, I seem to have hit another brick wall.
I have a table in my database: Photos; containing columns for PhotoID, Caption, Ordering, and four sets of binary data: Original, Large, Medium and Small (yes, it was based on the old ASP.NET starter kit with various fixes, e...
I'm using EF for a set of objects and want to query one type of object with the matching entries from two other tables. This is to dump the query into an XML output. At first, used a join since in the original data each Employee always had 1+ instances of a Computer object (solution #2 below), but it's not necessarily true.
For purpos...
Hi,
I am just getting started with the ADO.NET Entity Data Model and I was curious as to what was the best way of extending my entities behaviour.
Say I have a table called "Customers" and I create an entity model based on this table. I now have a "Customers" entity class. I want to now add some methods to this class and also make it i...
Hi,
I am trying something that i not really sure but i want to ask here if it s possible.
Is it able to be done ?
public IQueryable<Info> GetInfo(int count, byte languageId)
{
return db.Info.SelectMany(i => i.LanguageInfo)
.Where(l => l.Language.id == languageId)
...
I'am deploy one application that use Entity Framework with MySQL. I've got this error when I access the page. In my developer machine the system works perfectly, but in the server that I deploy the solution It's not work.
The scheme specified is not valid.
error 0040: The bool type is not qualified with a namespace or alias. Only Primit...
is there any tool or utility(mapper assembly) to construct business objects from entities(which are obtained from DB using linq -> sql , entity framework or whatever..)
in the absence of one , can anyone suggest the best way that can be accomplished rather can copy pasting the properties(what i'm doing right now) from the entity classes...
In a RIA Domain service I have added some utility functions. For instance we have...
public virtual CmsDealer GetCmsDealerById(string id)
{
return this.Context.CmsDealerSet
.Include("CmsItemState")
.FirstOrDefault(p => p.Id == id);
}
Now that function has it's own issues if the id is nonexistant, but lets table that for ...
Ok... I tried google and didn't get many hits. I dont want to abuse So but this is one of the best places to ask and EF isn't well documented.
My fails because the GetOriginal() returns null in UpdateCmsProductCategory. I assume that means currentCmsProductCategory is not in the ChangeSet. Ok... how do I put it in the changeset?
Here i...
When creating a new entity object that has a foreign key value I need to create a new Entity key (Entity Framework in .net 3.5) for the object, but I'm having trouble deciding where in my application I should do this.
Right now when I create a new record with a foreign key, I create the entity key in the controller (in this case a user ...
I have my data model in my ASP.NET website and what i'm attempting to do is retrieve tbl_company records and bind these to a datagrid in silverlight - pretty simple.
I set up my database so tbl_company has a foreign key (company_scope_id) that is linked to tbl_company_scope. From tbl_company_scope I basically want to show the column "sc...
I was looking at this SO question: http://stackoverflow.com/questions/1168215/ado-net-entity-framework-update-only-certian-properties-on-a-detached-entity. This was a big help for me. I know now that I need to attach an entity before making my changes to it. But how can do I do this:
I have an MVC website, a Customer Update Page with fi...