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. Image for the cookie policy date

Problem With Extra-Large Database

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

5 Replies

SJ Saravanan Janakiraman Syncfusion Team October 26, 2015 11:55 AM UTC

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



PB Pourrier Baner October 26, 2015 12:11 PM UTC

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".


SJ Saravanan Janakiraman Syncfusion Team October 27, 2015 11:30 AM UTC

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


PB Pourrier Baner October 27, 2015 12:15 PM UTC

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



FP Francis Paul Antony Raj Syncfusion Team October 28, 2015 02:57 PM UTC

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


Loader.
Live Chat Icon For mobile
Up arrow icon