This is a migrated thread and some comments may be shown as answers.

Tree View Webservice Error

3 Answers 46 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Usman
Top achievements
Rank 1
Usman asked on 05 Nov 2008, 01:09 PM
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;

 

}

3 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 05 Nov 2008, 02:13 PM
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.
0
Usman
Top achievements
Rank 1
answered on 06 Nov 2008, 09:27 AM
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


0
Veselin Vasilev
Telerik team
answered on 06 Nov 2008, 10:05 AM
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.
Tags
TreeView
Asked by
Usman
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Usman
Top achievements
Rank 1
Share this question
or