input search list throwing a stack overflow error RRS feed

  • Question

  • User219039814 posted

    I want a text box on the form, which acts like a search box. when i start typing the roll numbers, it should automatically fill it up.

    this text box in bind with a query which fetches around 400 roll nos from the database.

    <label> Type the Registration Number</label>
    <input list="rollnos" autocomplete="off" type="search" id="f" class="form-control" runat="server" onload="getStudentWise" ><span id="errmsg"></span>
    <datalist id="rollnos" runat="server" > </datalist>

    Below is the code in code behind.

    If the query is for top 200 or something below 200 rollnos,it works fine.

    but  the query is "select regdno from student_master where college_code='GIMSR' and status='S'    // this should fetch around 450 records.

    the above query automatically gives a stack overflow exception error.. 

    string query = "select top 250 regdno from STUDENT_MASTER where COLLEGE_CODE='GIMSR' and status='S' order by regdno";
    cmd = new SqlCommand(query, conn);
    rs = new SqlDataAdapter(cmd);
    ds = new DataSet();
    table1 = ds.Tables[0];

    for (int i = 0; i < table1.Rows.Count; i++)
    builder.Append(String.Format("<option value='{0}'>", table1.Rows[i][0]));

    rollnos.InnerHtml = builder.ToString();
    f.Attributes["list"] = rollnos.ClientID;

    can any one help me

    Saturday, May 26, 2018 5:16 AM

All replies