Tree View Webservice Error

4 posts, 0 answers
  1. Usman
    Usman avatar
    18 posts
    Member since:
    Oct 2008

    Posted 05 Nov 2008 Link to this post

    when i m trying to call data from sql server to the treeview using webservice i getting the following  error

    Error during Serialization or deserialization using the JSON Javascript Serializer.The Length of the string exceeds the value set on the max JSONlength property.

    this is my following code in webservice method

    private

     

    DataTable GetProductCategories1(object categoryId)

     

    {

     

    SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["hakConnectionString"].ConnectionString);

     

     

    SqlCommand selectCommand = new SqlCommand(@"Select * From Table911 where Left(Fld121,1) like '" + categoryId + "'" ,connection);

     

     

    //selectCommand.Parameters.AddWithValue("parentId", categoryId);

     

     

    SqlDataAdapter adapter = new SqlDataAdapter(selectCommand);

     

     

    DataTable productCategories = new DataTable();

     

    adapter.Fill(productCategories);

     

    return productCategories;

     

    }

  2. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 05 Nov 2008 Link to this post

    Hello Usman,

    Please check this article: Maximum length exceeded error when loading nodes from WebService

    Kind regards,
    Veselin Vasilev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Usman
    Usman avatar
    18 posts
    Member since:
    Oct 2008

    Posted 06 Nov 2008 Link to this post

    thank u for ur reply

    i used ur web config file code  and i copied data into that its working fine but its showing a another window message

    saying that

    stop running this script?
    A script on the page is causing inter net explorer  to run slowly. If it continues , your computer  may become unresponsive.

    plz reply me


  4. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 06 Nov 2008 Link to this post

    Hello Usman,

    We have a troubleshooting article for this error too:
    A script causes IE to run slowly

    All the best,
    Veselin Vasilev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top