We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Problem With Extra-Large Database

Thread ID:

Created:

Updated:

Platform:

Replies:

120874 Oct 23,2015 11:11 AM Oct 28,2015 10:57 AM ASP.NET MVC 5
loading
Tags: AutoComplete
Pourrier Baner
Asked On October 23, 2015 11:11 AM

Hi there,

I am using Asp.NET MVC5 and I have a Problem with Autocomplete Control.
I need to load the datasource but i have a error : "Out of Memory"
It is possible to load the datasource after the user enters 2 or 3 words ? this may reduce the datasource weight.

Regards,
Baner

Saravanan Janakiraman [Syncfusion]
Replied On October 26, 2015 07:55 AM

Hi Pourrier,

Thanks for contacting Syncfusion support.

In our control, the “minCharacter” is used to achieve your requirement. The datasource will load only after the number of characters be pressed which has mentioned in the property value. We have attached a sample in the following location to showcase your requirement, kindly check it.

Please refer the below code snippet:

$('#selectCar').ejAutocomplete({

    dataSource: carList,

    minCharacter: 3
});

 

Please refer to the below link for the solution:

 

JS Playground Link: http://jsplayground.syncfusion.com/ucead2ml


If you want to know how to get started about our components, please check the below link: 
http://help.syncfusion.com/js/overview 

You could also find all the samples of our components in the following link location:
http://js.syncfusion.com/demos/web/ 


Regards,
Saravanan A J


Pourrier Baner
Replied On October 26, 2015 08:11 AM

Hi,

Thanks for your reply,

I test this with Razor Syntax  : @Html.EJ().Autocomplete("Raf_Liste").MinCharacter(3)
But i keep this javascript exception : "out of memory".

Saravanan Janakiraman [Syncfusion]
Replied On October 27, 2015 07:30 AM

Hi Pourrier,

Thanks for your update.

We are unable to reproduce the issue at our end. We have loaded nearly 20,000 records through datasource into the autocomplete control and it does not throw any exception/error as out of memory. Could you please check with the sample in the following location?

Sample Location: Autocomplete Sample

Could you please provide answers for the following queries?

The number of records you are loading into Autocomplete.

Screenshot/Video to showcase the issue at our end.

Is this problem occurring in all the browsers?

If possible please provide sample to showcase the issue, or please provide the requested information which would be helpful for us to investigate further and provide you the exact solution.

Regards,
Saravanan A J

Pourrier Baner
Replied On October 27, 2015 08:15 AM

Hi,

Thanks for your reply.

I can't test the sample... There is a error when I extract the .Zip
For the issue, my problem appears when I need to use Autocomplete Component with a query that returns +350000 records.
I've used the mincharacter property but, i have the same error.

Regards,
Baner


Francis Paul Antony Raj [Syncfusion]
Replied On October 28, 2015 10:57 AM

Hi Baner,

We suggest you to avoid populating the autocomplete with more data directly. So to use such large database, we can use the Datamanager object on the controller side to filter out the data based on the typed character and then pass the Json result to the view page.

Please refer the following code snippet.



@Html.EJ().Autocomplete("stateSelect").Width("205").Datasource(d => d.URL("/home/getdata").Offline(false).Adaptor("UrlAdaptor")).Query("ej.Query()").AutocompleteFields(f => f.Text("dataValue").Key("index")).WatermarkText("Select a Value").MinCharacter(2)



public JsonResult getdata(DataManager dm)   {

List<Sample> sampledata = new List<Sample>();

for (var i = 1; i <= 350000; i++)

{

    if (i > 0 && i <= 40000)

    {

    sampledata.Add(new Sample { index = "s" + i, dataValue = "avalue" + i });

    }

    else if (i > 40000 && i <= 80000)

    {

    sampledata.Add(new Sample { index = "s" + i, dataValue = "bvalue" + i });

    }

    /*....*/           

}

//here you need to filter the data based on the character typed

string r = dm.Where[0].value.ToString();

var searchResult = from n in sampledata where n.dataValue.StartsWith(r) select n;

return Json(searchResult, JsonRequestBehavior.AllowGet);

}



We have attached the sample for your convenience, please check the following link.                     

http://www.syncfusion.com/downloads/support/forum/120874/ze/Autocomplete_Sample633130584


If still you face difficulties, please revert back the provided sample to showcase the issue, or please provide screenshot or video to showcase the issue which would be helpful for us to investigate further and provide you the exact solution.


Regards,

Francis Paul A


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;