本文介绍了使用存储过程获取大量JSON结果 - 紧急!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! Hi Team, 我们正在使用以下查询检索记录。 CREATE PROCEDURE ListAllHistoryWallBySearch AS BEGIN SELECT * FROM HistoryWall WHERE Isdeleted = 0 FOR JSON PATH,INCLUDE_NULL_VALUES 结束 C#.NET代码如下: ----------------------------------------------- -------------------------------------------------- - StringBuilder mJsonResponse = new StringBuilder(10 * 100 * 1024); mJsonResponse.Clear(); using(SqlDataReader reader = SqlHelper .ExecuteReader(ConnectionString," [ListAllHistoryWallBySearch]",new object [0])) { if(reader.HasRows) {     while(reader.Read())     {         mJsonResponse.Append(reader [0] .ToString());     } } else { mJsonResponse.Append(" []"); } } 返回mJsonResponse.ToString(); ------------------------------------------- -------------------------------------------------- ----- 请告知上面的代码好吗? 问题: 1. Json Result的最大值是否适合字符串生成器? 2.如何在C#中处理大量的json结果客户端? 问候 Kannan ERS 解决方案 Hi Team,We are retrieving the records using the following query.CREATE PROCEDURE ListAllHistoryWallBySearchASBEGIN SELECT * FROM HistoryWall WHERE Isdeleted = 0 FOR JSON PATH, INCLUDE_NULL_VALUESENDC#.NET CODE as follows:--------------------------------------------------------------------------------------------------StringBuilder mJsonResponse = new StringBuilder(10*100*1024);mJsonResponse.Clear();using (SqlDataReader reader = SqlHelper.ExecuteReader(ConnectionString, "[ListAllHistoryWallBySearch]", new object[0])){ if (reader.HasRows) { while (reader.Read()) { mJsonResponse.Append(reader[0].ToString()); } } else { mJsonResponse.Append("[]"); }}return mJsonResponse.ToString();--------------------------------------------------------------------------------------------------Please advise the above code OK? Questions:1.What is the maximum of Json Result accomidate to string builder?2.How to handle large volume of json results in C# client side?RegardsKannanERS 解决方案 这篇关于使用存储过程获取大量JSON结果 - 紧急!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-15 22:41