Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
180
EntitySqlException
posted

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?

Parents
No Data
Reply Children