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
2 answers

SelectedValue which is invalid because it does not exist in the list of items, how to handle this error

I am getting the below error when I try to bind data. SelectedValue which is invalid because it does not exist in the list of items
BenW
  • 1,393
  • 1
  • 16
  • 26
0
votes
1 answer

entitydatasource value retrieval

I have an entitydatasource defined in the markup as so
dinotom
  • 4,990
  • 16
  • 71
  • 139
0
votes
0 answers

JQGrid with EntityDataSource not getting column from related object

JQGrid with EntityDataSource not getting column from related object The field Number from the Phone table which is related by phoneid in VetCertifieds gives an error:The column with DataField=Phone.Number does not exist in the…
mackjazzy
  • 48
  • 1
  • 8
0
votes
1 answer

building entity data source control from code behind

if i have an entitydatasource control in my aspx (which looks like so and was created by the configure wizard in the designer and works)
dinotom
  • 4,990
  • 16
  • 71
  • 139
0
votes
2 answers

Using entitydatasource with editable gridpanel

i am new at ext.net. i am trying to make an editable grid with using entitydatasource Here is code:
Mehmet
  • 1
  • 4
0
votes
1 answer

How to perform a Like type query using WhereParameters and EntityDataSource

In the code-behind I want to apply a dynamic where clause for the entitydatasource, but I want this where to be like and not equal. I have this code working which is equal I want an equivalence code that somehow translates this into a Like…
rtp
  • 794
  • 1
  • 10
  • 26
0
votes
1 answer

Entitydatasource to Datatable

I have a Gridview that reads the DataSource from an EntityDataSrouce. Now I want to convert the EntityDatasource of the gridview to DataTable so I can export it the Gridview as an Excel file.
rtp
  • 794
  • 1
  • 10
  • 26
-1
votes
1 answer

sort entity data source in command text

Database Oracle 11g: I have 2 table to be join (user,comment) in user table have PK User_ID and Name and in comment table have FK User_ID and Text. I want to show Name and Text in GridView using EntityDataSource, it's work fine but when I do sort in…
-1
votes
1 answer

Using DISTINCT with an EntityDataSource

I have an entity datasource (connetced to a SQL Server 2012 database) on a .NET v4 aspx page. My datasource declaration looks like this:
Martin
  • 45
  • 1
  • 5
1 2 3
10
11