Click here to Skip to main content
15,898,222 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: dropdownlist auto select first value in gridview with edit mode Pin
Karthik Harve3-Mar-13 23:38
professionalKarthik Harve3-Mar-13 23:38 
GeneralRe: dropdownlist auto select first value in gridview with edit mode Pin
demoninside93-Mar-13 23:53
demoninside93-Mar-13 23:53 
GeneralRe: dropdownlist auto select first value in gridview with edit mode Pin
Karthik Harve3-Mar-13 23:59
professionalKarthik Harve3-Mar-13 23:59 
GeneralRe: dropdownlist auto select first value in gridview with edit mode Pin
demoninside93-Mar-13 23:57
demoninside93-Mar-13 23:57 
GeneralRe: dropdownlist auto select first value in gridview with edit mode Pin
Karthik Harve4-Mar-13 0:04
professionalKarthik Harve4-Mar-13 0:04 
Questionhow to make multiple entries for a book in database for multiple copies of the same book in a library? Pin
Madhubala Ganesan2-Mar-13 6:33
Madhubala Ganesan2-Mar-13 6:33 
AnswerRe: how to make multiple entries for a book in database for multiple copies of the same book in a library? Pin
Bernhard Hiller3-Mar-13 20:35
Bernhard Hiller3-Mar-13 20:35 
QuestionJson + asp.net Pin
jojoba20112-Mar-13 4:45
jojoba20112-Mar-13 4:45 
when i run like this :

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

the source is :
C#
<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" %>


<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<dictionary<string, object="">> list = new List<dictionary<string, object="">>();
while (rdr.Read())
{
Dictionary<string, object=""> d = new Dictionary<string, object="">(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<br />
System.InvalidOperationException: Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.<br />
   at System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, StringBuilder output, SerializationFormat serializationFormat)<br />
   at System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj, SerializationFormat serializationFormat)<br />
   at System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj)<br />
   at ASP.test_aspx.Page_Load(Object sender, EventArgs e) in testing.com\test.aspx:line 44

AnswerRe: Json + asp.net Pin
jkirkerx4-Mar-13 10:36
professionaljkirkerx4-Mar-13 10:36 
QuestionRe: Json + asp.net Pin
jojoba20119-Mar-13 17:58
jojoba20119-Mar-13 17:58 
AnswerRe: Json + asp.net Pin
jkirkerx9-Mar-13 18:19
professionaljkirkerx9-Mar-13 18:19 
Questionerror '80004003', Object reference not set to an instance of an object. Pin
notahack2-Mar-13 4:37
notahack2-Mar-13 4:37 
AnswerRe: error '80004003', Object reference not set to an instance of an object. Pin
Richard MacCutchan2-Mar-13 5:42
mveRichard MacCutchan2-Mar-13 5:42 
Questionplugging in twitter and facebook into the web application Pin
Member 87018131-Mar-13 3:04
Member 87018131-Mar-13 3:04 
AnswerRe: plugging in twitter and facebook into the web application Pin
Sandeep Mewara1-Mar-13 4:24
mveSandeep Mewara1-Mar-13 4:24 
GeneralRe: plugging in twitter and facebook into the web application Pin
Member 87018131-Mar-13 8:32
Member 87018131-Mar-13 8:32 
GeneralRe: plugging in twitter and facebook into the web application Pin
Sandeep Mewara1-Mar-13 9:04
mveSandeep Mewara1-Mar-13 9:04 
GeneralRe: plugging in twitter and facebook into the web application Pin
Member 87018132-Mar-13 21:25
Member 87018132-Mar-13 21:25 
GeneralRe: plugging in twitter and facebook into the web application Pin
Member 87018131-Mar-13 23:02
Member 87018131-Mar-13 23:02 
QuestionInvalid length for a Base-64 char array Pin
Anshul Jindal1-Mar-13 1:51
Anshul Jindal1-Mar-13 1:51 
AnswerRe: Invalid length for a Base-64 char array Pin
Simon_Whale1-Mar-13 1:56
Simon_Whale1-Mar-13 1:56 
GeneralRe: Invalid length for a Base-64 char array Pin
Anshul Jindal1-Mar-13 2:02
Anshul Jindal1-Mar-13 2:02 
AnswerRe: Invalid length for a Base-64 char array Pin
jkirkerx3-Mar-13 12:09
professionaljkirkerx3-Mar-13 12:09 
GeneralRe: Invalid length for a Base-64 char array Pin
Anshul Jindal3-Mar-13 16:46
Anshul Jindal3-Mar-13 16:46 
GeneralRe: Invalid length for a Base-64 char array Pin
jkirkerx4-Mar-13 6:39
professionaljkirkerx4-Mar-13 6:39 

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

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