Hi Team,
I have a problem with the webdatagrid using <asp:EntityDataSource>. I have configured the datasource like this:
<asp:EntityDataSource ID="EntityDataSource_D_CG_SYSTEM_ROLE" runat="server" ConnectionString="name=DBEntities" DefaultContainerName="DBEntities" EnableDelete="True" EnableFlattening="False" EnableInsert="True" EnableUpdate="True" EntitySetName="D_CG_SYSTEM_ROLE" > </asp:EntityDataSource>
D_CG_SYSTEM_ROLE is my table in the oracle database and the name of the entity class.
DBEntities is the entity container name.
I can insert, update and delete without problems using this datasource and the grid. But when I try to set a filter I get an [EntitySqlException]:
'DICT_ENTRY' could not be resolved in the current scope or context. Make sure that all referenced variables are in scope, that required schemas are loaded, and that namespaces are referenced correctly. Near escaped identifier, line 6, column 1.
I bind the data to the grid like this:
if (e.NewValue.ToString() == "D_CG_SYSTEM_ROLE"){ this.WebDataGrid.DataSourceID = "EntityDataSource_D_CG_SYSTEM_ROLE"; BoundDataField boundField1 = new BoundDataField(true); boundField1.Key = "DICT_ENTRY"; boundField1.Header.Text = "DICT_ENTRY"; boundField1.DataFieldName = "DICT_ENTRY"; // ADD COLUMNS this.WebDataGrid.Columns.Clear(); this.WebDataGrid.Columns.Add(boundField1); this.WebDataGrid.RequestFullAsyncRender();
}
Do you have any suggestions what I'm doing wrong?
Hi Jenswitte19,
We are still following this forum thread.Have you been able to take a look at the provided link ?
If you have any other questions please do not hesitate to contact us.
Sincerely,
Dimi
Developer Support Engineer
Infragistics
www.infragistics.com/support
Hi Team.
sorry for my late reply, I was on vacation.
I looked at the link but nothing in this post helped me.
I tried to get closer to the problem but I'm still not able to solve it. First I thought it could be a problem with the Oracle database, so I created a new solution and mapped it with a sql server db. The problem still exists.
What I did:
- Create a new solution in Visual Studio (ASP.net Web Application)
- Create new database, create a new table on a sql server
- Add a new 'Ado.net Entity Data Model' and connect it to the SQLServer DB
- Add to default.aspx: ScriptManager, EntitiyDataSource, WebDataGrid
- Connect them. After that it looks like that:
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:EntityDataSource ID="EntityDataSource1" runat="server" ConnectionString="name=Entities" DefaultContainerName="Entities" EntitySetName="VALUE_TYPE" >
</asp:EntityDataSource>
<ig:WebDataGrid ID="WebDataGrid1" runat="server" Height="350px" Width="400px" DataSourceID="EntityDataSource1" >
<Behaviors>
<ig:Filtering>
</ig:Filtering>
</Behaviors>
</ig:WebDataGrid>
The name of my table is 'VALUE_TYPE'
- Run it. I get the decribed error.
Perhaps you can try the same to help me?