Click here to Skip to main content
   

ASP.NET

 
GeneralRe: dropdownlist auto select first value in gridview with edit mode PinmemberKarthik Harve3-Mar-13 23:00 
GeneralRe: dropdownlist auto select first value in gridview with edit mode Pinmemberdemoninside93-Mar-13 23:13 
GeneralRe: dropdownlist auto select first value in gridview with edit mode PinmemberKarthik Harve3-Mar-13 23:23 
GeneralRe: dropdownlist auto select first value in gridview with edit mode Pinmemberdemoninside93-Mar-13 23:27 
GeneralRe: dropdownlist auto select first value in gridview with edit mode PinmemberKarthik Harve4-Mar-13 0:23 
GeneralRe: dropdownlist auto select first value in gridview with edit mode Pinmemberdemoninside94-Mar-13 0:35 
GeneralRe: dropdownlist auto select first value in gridview with edit mode PinmemberKarthik Harve4-Mar-13 0:38 
GeneralRe: dropdownlist auto select first value in gridview with edit mode Pinmemberdemoninside94-Mar-13 0:53 
GeneralRe: dropdownlist auto select first value in gridview with edit mode PinmemberKarthik Harve4-Mar-13 0:59 
GeneralRe: dropdownlist auto select first value in gridview with edit mode Pinmemberdemoninside94-Mar-13 0:57 
GeneralRe: dropdownlist auto select first value in gridview with edit mode PinmemberKarthik Harve4-Mar-13 1:04 
Questionhow to make multiple entries for a book in database for multiple copies of the same book in a library? PinmemberMadhubala Ganesan2-Mar-13 7:33 
AnswerRe: how to make multiple entries for a book in database for multiple copies of the same book in a library? PinmemberBernhard Hiller3-Mar-13 21:35 
QuestionJson + asp.net Pinmemberjojoba20112-Mar-13 5:45 
when i run like this :

testing.com/test.aspx?query=select top(60000) * from [dbo].tblTesting

the source is :
<pre lang="c#"><pre lang="c#">
<%@ Page Language="C#"%>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Web.Script.Serialization" %>
<%@ Import Namespace="System.Text" %>
<%@ Import Namespace="System" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{

using (SqlConnection cn = new SqlConnection("Data Source=127.22.125.11,1985;Initial Catalog=Test;uid=testing;pwd=123456"))
{
using (StreamReader sr = new StreamReader(Request.InputStream, Encoding.UTF8))
{
Response.ContentType = "text/plain";
string c;
c = Request.QueryString["query"]; //for debugging with the browser
//you can set the query by adding the query parameter For ex: http://127.0.0.1/test.aspx?query=select * from table1
if (c == null)
c = sr.ReadToEnd();
try
{
SqlCommand cmd = new SqlCommand(c, cn);
cn.Open();
SqlDataReader rdr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
List> list = new List>();
while (rdr.Read())
{
Dictionary d = new Dictionary(rdr.FieldCount);
for (int i = 0; i < rdr.FieldCount; i++)
{
d[rdr.GetName(i)] = rdr.GetValue(i);
}
list.Add(d);
}
JavaScriptSerializer j = new JavaScriptSerializer();
j.MaxJsonLength = Int64.MaxValue;
Response.Write(j.Serialize(list.ToArray()));

}
catch (Exception ex)
{
Response.TrySkipIisCustomErrors = true;
Response.StatusCode = 500;
Response.Write("Error occurred. Query=" + c + "\n");
Response.Write(ex.ToString());

}
Response.End();
}
}
}
</script>
the error is :

Error occurred. Query=select top(60000) * from [dbo].tblTesting
System.InvalidOperationException: Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.
at System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, StringBuilder output, SerializationFormat serializationFormat)
at System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, SerializationFormat serializationFormat)
at System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj)
at ASP.test_aspx.Page_Load(Object sender, EventArgs e) in testing.com\test.aspx:line 44

AnswerRe: Json + asp.net Pinmemberjkirkerx4-Mar-13 11:36 
QuestionRe: Json + asp.net Pinmemberjojoba20119-Mar-13 18:58 
AnswerRe: Json + asp.net Pinmemberjkirkerx9-Mar-13 19:19 
Questionerror '80004003', Object reference not set to an instance of an object. Pinmembernotahack2-Mar-13 5:37 
AnswerRe: error '80004003', Object reference not set to an instance of an object. PinmvpRichard MacCutchan2-Mar-13 6:42 
Questionplugging in twitter and facebook into the web application PinmemberMember 87018131-Mar-13 4:04 
AnswerRe: plugging in twitter and facebook into the web application PinmvpSandeep Mewara1-Mar-13 5:24 
GeneralRe: plugging in twitter and facebook into the web application PinmemberMember 87018131-Mar-13 9:32 
GeneralRe: plugging in twitter and facebook into the web application PinmvpSandeep Mewara1-Mar-13 10:04 
GeneralRe: plugging in twitter and facebook into the web application PinmemberMember 87018132-Mar-13 22:25 
GeneralRe: plugging in twitter and facebook into the web application PinmemberMember 87018132-Mar-13 0:02 
QuestionInvalid length for a Base-64 char array PinmemberAnshul Jindal1-Mar-13 2:51 
AnswerRe: Invalid length for a Base-64 char array PinmemberSimon_Whale1-Mar-13 2:56 
GeneralRe: Invalid length for a Base-64 char array PinmemberAnshul Jindal1-Mar-13 3:02 
AnswerRe: Invalid length for a Base-64 char array Pinmemberjkirkerx3-Mar-13 13:09 
GeneralRe: Invalid length for a Base-64 char array PinmemberAnshul Jindal3-Mar-13 17:46 
GeneralRe: Invalid length for a Base-64 char array Pinmemberjkirkerx4-Mar-13 7:39 
AnswerRe: Invalid length for a Base-64 char array Pinmemberjkirkerx4-Mar-13 9:53 
QuestionRotating Homepage banner up to 5 banner images PinmemberMember 870181328-Feb-13 16:50 
AnswerRe: Rotating Homepage banner up to 5 banner images Pinmemberdeflinek1-Mar-13 2:29 
GeneralRe: Rotating Homepage banner up to 5 banner images PinmemberMember 87018131-Mar-13 3:41 
GeneralRe: Rotating Homepage banner up to 5 banner images Pinmemberdeflinek1-Mar-13 3:51 
GeneralRe: Rotating Homepage banner up to 5 banner images PinmemberMember 87018131-Mar-13 9:07 
QuestionRe: Rotating Homepage banner up to 5 banner images Pinmemberjkirkerx1-Mar-13 12:42 
AnswerRe: Rotating Homepage banner up to 5 banner images PinmemberMember 87018131-Mar-13 16:25 
GeneralRe: Rotating Homepage banner up to 5 banner images Pinmemberjkirkerx2-Mar-13 9:06 
GeneralRe: Rotating Homepage banner up to 5 banner images [modified] PinmemberMember 87018132-Mar-13 22:58 
GeneralRe: Rotating Homepage banner up to 5 banner images Pinmemberjkirkerx3-Mar-13 8:41 
QuestionRole based security Pinmembervanikanc28-Feb-13 11:51 
AnswerRe: Role based security PinmvpRahul Rajat Singh28-Feb-13 19:05 
GeneralRe: Role based security Pinmembervanikanc4-Mar-13 3:58 
QuestionCreate a basic captcha in C#.net PinmemberMember 870181328-Feb-13 5:54 
AnswerRe: Create a basic captcha in C#.net [modified] PinmvpSandeep Mewara28-Feb-13 6:03 
GeneralRe: Create a basic captcha in C#.net PinmemberMember 870181328-Feb-13 6:13 
GeneralRe: Create a basic captcha in C#.net PinmvpSandeep Mewara28-Feb-13 6:29 
GeneralRe: Create a basic captcha in C#.net PinmemberMember 870181328-Feb-13 7:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.150414.1 | Last Updated 18 Apr 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid