Lookup to big table (lookup and lookup popup)

Hi,

I have a problem when creating lookup from a table with more than 200000 rows.

Error message:
System.InvalidOperationException: 'AsyncEnumerableReader' reached the configured maximum size of the buffer when enumerating a value of type 'Microsoft.EntityFrameworkCore.Internal.InternalDbSet1[--my model--]'. This limit is in place to prevent infinite streams of 'IAsyncEnumerable<>' from continuing indefinitely. If this is not a programming mistake, consider ways to reduce the collection size, or consider manually converting 'Microsoft.EntityFrameworkCore.Internal.InternalDbSet1[--my model--]' into a list rather than increasing the limit.

I've read Lookup to large Dataset (CRUD pages) times out and I've checked the option when creating the page.

Are there any workaround for me?

TIA.

You need to use the DropDownDataGrid component instead of DropDown.

1 Like

Did you mean this component?

image

I've tried it, and get the same result (same error message).

This is the properties of the field in the input form:

Thanks for your reply.

Paging is enabled via the LoadData event of the DropDownList. I recommend using the CRUD page wizard - it generates paging, sorting and filtering code when "Allow paging, sorting and filtering of lookup data" is checked:

I already did that. The one I capture is the properties of one field in the Input page's form generated by Radzen CRUD Pages wizard (I've marked the "Allow paging, sorting and filtering of lookup data" option).

After the wizard, I got 3 pages. Add (form input), Edit (form input), List (datagrid). In the "Add" page there is a form which contains fields of the table. I change one of the field (in my case ClientNID) to lookuppopup and assign the "Data", "Text Property" and "Value Property", I also provide the "Columns" property with correct column from the Client table.

When I run and open the list and click the add button, after a while in the browser I see a 500 Internal server error. I posted the error message in my first post.

It is the same when I use "lookup" component.

Thanks.

IF you are manually adding the DropDownDataGrid you have to handle the LoadData event of the form. Again - check how the autogenerated form behaves. Radzen needs to have a foreign key relationship between the related tables in order to generate DropDown or DropDownDataGrid editor.

I'm not adding the DropDownDataGrid manually. I explained in my previous post, the page already generated with a form and inside the form there are the table's fields.

When I click the button to edit the "Fields" in the property, then a dialog popped up.

In this dialog I change the type of ClientNID field from 'integer' to 'lookuppopup' and supply the properties accordingly: "Data", "TextProperty" and "ValueProperty".

And yes, I defined the relationships between the related tables in the database.

Still got the same error message above. And I'm using the latest update (ver 2.56.4).

Btw, I can use 'lookup' to another table even without relationship if the table not to big. In my case, the user table is about 2000 rows (can use lookup), but not client table (about 200000 rows).

Edit: FYI, the client table have a lot of fields (not only a lot of rows) but I only show 3 fields to the lookup (as the screenshot before).

It's my chrome's developer console screenshot:

Thanks

This is what I refer to as manually creating a lookup - it needs additional configuration. I have answered a few times what you should do and can't add anything else.

Okay, thank you for being patient with me.

Actually, I have done the same thing to not so big table, and I'm facing different problem than this.

I posted it here: Lookup popup only show 1 page

My conclusion: I have to manage LoadData event of the form, so I dont load so many rows for DropDownDataGrid.

Thank you for your help.