Questions tagged [entitydatasource]

EntityDataSource is an ASP.NET web server control available in .NET Framework 3.5 SP1 or later. It supports declarative data-binding of other web controls to an Entity Data Model of Entity Framework.

EntityDataSource is an ASP.NET web server control available in .NET Framework 3.5 SP1 or later.

EntityDataSource belongs to a family of server controls - like ObjectDataSource, SqlDataSource or XmlDataSource - which allow data-binding of web controls to a data source.

EntityDataSource is specifically tailored to interact with an Entity Data Model provided by Entity Framework. It supports declarative definition of CRUD operations in an ASPX web page as well as sorting, paging, data projections and various kinds of parameters to specify parametrized queries - like ControlParameter, QueryStringParameter, ProfileParameter and others.

Example

The following EntityDataSource configures data-binding to an Entity Data Model called "NorthwindEntitiesContext", selects an Order including all OrderDetails by an ID entered in a TextBox control and allows updating, inserting and deleting of Order objects:

<asp:EntityDataSource ID="NorthwindEntityDataSource" runat="server" 
    ConnectionString="name=NorthwindEntitiesContext" 
    DefaultContainerName="NorthwindEntitiesContext" 
    EntitySetName="Orders" 
    Include="OrderDetails"
    EnableUpdate="True" EnableInsert="True" EnableDelete="True"
    AutoGenerateWhereClause="True">
    <WhereParameters>
        <asp:ControlParameter Name="OrderID" ControlID="TextBoxOrderID" 
            DbType="Int32" PropertyName="Text" />
    </WhereParameters>
</asp:EntityDataSource>

Resources

159 questions
0
votes
1 answer

How to get to the next level of Assocation in an EF4 EntityDataSource?

I've used EF4 EntityDataSources to do DataBinding with success, but here's a case where I'm stumped: Table "CurrentComplaintsByUsers" has a foreign key over to a "Complaints" table. So in EF, I can access a CurrentComplaintByUser record, and…
Graham
  • 3,217
  • 1
  • 27
  • 29
0
votes
2 answers

Better to put business logic in WCF Service or Code behind on Silverlight control?

In trying to design an architecture for a Silverlight application, I am at a point in asking is it better to: use an Entity Data Model with a WCF Data Service and then put my business logic in the code-behind for my silverlight user control to do…
Chris
  • 55
  • 5
0
votes
1 answer

EntityDataSource Control get DataSource Manual

Shouldn't we be able to ise the DataSource Controls and append data to it from our Data Repository Class Library instead of using declarative the controls but using them with our own select, insert, update, delete methods? Something similar with…
George Taskos
  • 8,324
  • 18
  • 82
  • 147
0
votes
2 answers

EntityDataSource ,Select * From?

for example,
Cheung
  • 15,293
  • 19
  • 63
  • 93
0
votes
0 answers

Entitydatasource EF6 Boolean [ERROR]

In VS2015 im using web application with OracleDB and i'm trying to do the connection with Entitydatasource wizard.Everything works fine and smooth even though i have EF6 but if any of the tables im trying to load has a Boolean type (number(1,0) in…
Tr0n
  • 1
0
votes
1 answer

ASP.NET WebForms change insert operation into update at runtime

Let's say I have a page with FormView where there is a form allowing to register article into database. User can fill some properties like Number, Description etc. I use EntityDataSource. I can perform insert/update operations. The problem is that…
Ryfcia
  • 417
  • 8
  • 11
0
votes
1 answer

Unable to cast object of type 'System.Data.Objects.MaterializedDataRecord' to type 'myEntity' error

I am using an EntityDataSource. I want to access the results and convert them to a List. To do that I'm doing the following code: protected void EntityDatSrc_Selected(object sender, EntityDataSourceSelectedEventArgs e) { var statHistLst…
Dov Miller
  • 1,958
  • 5
  • 34
  • 46
0
votes
2 answers

SQL from EntityDataSource

Is there an easy way to see SQL statements generated by EntityDataSource? SQL Server profiling/tracing is not an option here.
Valera
  • 537
  • 7
  • 14
0
votes
1 answer

Microsoft.AspNet.EntityDataSource gives wrong entity's property value during Updating or Deleting

I am using the Microsoft.AspNet.EntityDataSource like this: ASPX:
procma
  • 1,174
  • 3
  • 14
  • 24
0
votes
1 answer

gridview filtering via joined tables

I'm trying to display data which comes from a join on two tables (or more) in a gridview I want to be able to filter the result set via user given input (text boxes on page) I have tried the standard tutorials but cannot find something which goes…
0
votes
1 answer

ASP.NET Declarative Data Sources. Are they ever used if more than one table is involved?

For typical examples I see of SqlDataSource, LinqDataSource... EVERY example deal with how to make changes to a Customer table where the Gridview/RADgrid directly represents the customer.. But in my case I have stored procedure which show data from…
punkouter
  • 5,170
  • 15
  • 71
  • 116
0
votes
0 answers

Unable to load the specified metadata resource && the assembly specified does not exist in the assemblies enumration

I'm facing this error while using EntityDataSource Solutions I've tried 1- Built the solution 'ctrl + shift + B' 2- In web config file changed the resources From "metadata= res://*/GreenCityModel.csdl| res://*/GreenCityModel.ssdl| …
0
votes
1 answer

Linq query giving exception on EntityDataSource1_QueryCreated Event when I put Select new{};

I have entity data-source on which i have used Query-created event to get Total amount but when I bind gridview it Gives Exception An instance of ObjectQuery for unexpected result type '<>f__AnonymousType3`5' was assigned to Query in the…
Akash
  • 125
  • 1
  • 3
  • 14
0
votes
1 answer

Visual Studio 2015 crashes when adding new data source

i am building project and i use entity framework i need to create a new data source to use it to read and write from the data base like this tutorial…
0
votes
0 answers

Telerik Radgrid '' is not a member of type '' in the currently loaded schemas

I am using Telerik Radgrid in my Asp.Net Web application. The grid has datasource assigned from asp:EntityDataSource. There is one extra column i have added which is not a part of asp:EntityDataSource but i calculated it on ItemDataBound event of…
BHAVIN
  • 1