.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Json Deserialization is giving error in IronPython

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net


Have anyone tried json deserialization. When I tried:

>>> import json

>>> json.loads('["foo", {"bar":["baz", '"Test", 1.0, 2]}]')

I got following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\json\__init__.py", line
 307, in loads
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\json\scanner.py", line
42, in iterscan

View Complete Post

More Related Resource Links

Json Deserialization is giving error in IronPython



Have anyone tried json deserialization. When I tried:

>>> import json

>>> json.loads('["foo", {"bar":["baz", '"Test", 1.0, 2]}]')

I got following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\json\__init__.py", line
 307, in loads
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\json\scanner.py", line
42, in iterscan

HoverMenuExtender is giving me the error SYS.Extended.UI.PositioningMode.Aboslute is null or not an


Here is my Code....Any thoughts on what I am doing wrong? I pulled in the Ajax Tookit based on the instructions then was following the HoverMenuExtender tutorial.

Any info would be greatly apprecated!

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    <form id="form1" runat="server">
<asp:ScriptManager ID="asm" runat="server" />
      <asp:Repeater ID="rpOrders" runat="server">
          <br />
          <asp:Panel ID="myPanel" runat="server" Width="400px" BackColor="Lime" BorderWidth="1px">
              <%#DataBinder.Eval(Container.DataItem, &quo

Deserialization Error PropertyChangeEvent



I have a WebServiceHost which redrieves Data out of a . I have CommonDLL for all Properties. I used an ObjectBase Class with the inheritance in the common class. (with Implements InotifyPropertyChange and IDataErrorInfo). (This is Host side)

TheClient is a Web Padge which is showing data. Works fine. Except, if I do a ServiceReference update , I get a Compiler error: 

Public Property PropertyChangedEvent() As System.ComponentModel.PropertyChangedEventHandler Get Return Me.PropertyChangedEventField property 'PropertyChangedEvent' conflicts with a member implicitly declared for event 'PropertyChanged' in class 'ObjectBase'  in the Reference.vb

Now I was going to put more funcionallity to the Client ADD and UPDATE Data!

I recieving Now an Error Message while trying to add new Data:

 The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:Fahrz. The InnerException message was 'Error in line 1 position 369. 'Element' '_error' from namespace 'http://schemas.datacontract.org/.....Common' is not expected. Expecting element 'PropertyChangedEvent'.'. Please see InnerException for more details.

JSON.parse error

Hi all, I am fairly new to asp.net and am just learning JSON.  I am trying to display a JSON result in a partial view, but I am getting the JSON.parse error.  I know I am getting the JSON response back - I can see it in Firebug and it must be in the correct format as I am getting the JSON tab and the data looks correct.  I am not sure what I am doing wrong.  Any help is very much appreciated. Thanks in advance, Donna Here's my code: The partial view:<%@ Control Language="VB" Inherits="System.Web.Mvc.ViewUserControl(Of IEnumerable (Of gmcps.StateItem))" %> <script type="text/javascript"> function getSalesRepInfo(e) { alert("state chosen is " + e.value); $.ajax({ type: "POST", url: "salesRepresentatives", data: ({ id: e.value }), dataType: "json", success: function (data) { var myObject = JSON.parse(data, function (key, value) { var type; if (value && typeof value === 'object') { type = value.type; if (typeof type === 'string' && typeof window[type] === 'function') {

Testing JSON Deserialization

Hi all, Apologies for x-posting - I started here a week ago http://forums.asp.net/p/1112792/1718323.aspx#1718323 but haven't had any responses - so I'm hoping this is a better place.. :) I'm not using a webservice, I am just using the JavaScriptSerializer class within System.Web.Script.Serialization to serialise a complex object into a string (which works fine...) then use the same string to deserialize it back into the original object, which fails with the below error The value "System.Collections.Generic.Dictionary`2[System.String,System.Object]" is not of type "OrYx.TVShopping.TVScriptsTestHarness.Person" and cannot be used in this generic collection.Parameter name: value JSON string following serialization: "{\"Teacher\":\"Bugs\",\"Students\":[{\"Name\":\"Snoopy\",\"Birthday\":\"\\/Date(66661200000)\\/\",\"Age\":35},{\"Name\":\"Fred Bassett\",\"Birthday\":\"\\/Date(314888400000)\\/\",\"Age\":28}]}" My system: WinXP, .NET 2.0, AJAX ASP.NET RC1  The class being serialised (ClassRoom) contains a Dictionary class (Students).  It seems to get confused when trying to cast the dictionary (Students) object.  Aside: Serializing and deserializing objects containing only simple types (

SSIS Package working on SQL Client Machine but when trying to run on SQL Server machine giving error

Hi We are trying to run SSIS package on sql server machine but sometimes it is giving error for data flow task containing Script Component. Error is - [SSIS.Pipeline] Error: component "SCR DimensionRelation" (1) failed the post-execute phase and returned error code 0x80004002. This error is not coming continuously. And also not for specific DFT. It comes for different DFTs as we rerun the package. Can anybody help me on this? We are using SQL server 2008. We are not getting any error on client machine :(:(

mdx case giving #error

Basically I am trying to sum the NewCount across product &1 &2 .  If I remove NewCount and replace it standard Count I am able to get the results...guessing it's the way the cell are summed.  Any help will be great ! Thanks.    with MEMBER Measures.[NewCount] as format ( case        when [Dim Product].currentMember is [Dim Product].&[0] then Measures.[Count] * 1.24        when [Dim Product].currentMember is [Dim Product].&[1] then Measures.[Count] * 2.66        else 0      end   , "#" )  select     [Dim Date].[Year].[2009] on 0 ,  Measures. [NewCount] on 1  from   [DemoCube]   where   { [Dim Product].&[1], [Dim Product].&[2] }  

Validation.Error giving strange behavior

I'm seeing some weird behavior with the Validation.Error attached event. I have a textbox bound to an object that implements the IDataErrorInfo interface. The textbox subscribes to the Validation.Error event. What is weird is that when you put the text box into an invalid state, the Validation.Error event gets triggered twice. Under .NET 3.5, the first time ValidationErrorEventArgs.Action == Removed. The second time ValidationErrorEventArgs.Action == Added. Under .NET 4, it's reversed. The first time ValidationErrorEventArgs.Action == Added. The second time ValidationErrorEventArgs.Action == Removed. Why would it be called twice and why would it work differently under .NET 3.5 and .NET 4? I'm trying to implement a validation summary control similar to the one from ASP.NET. There is a solution here: http://codeblitz.wordpress.com/2009/05/12/wpf-validation-summary-control/ but it doesn't work under .NET 4 because in order for it work work, when you put a control into an invalid state, the last call to the Validation.Error event has to be with ValidationErrorEventArgs.Action == Added. Here is my code:   <Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:WpfApplicatio

A customized EditForm.aspx page giving error because it has a "People and Group" field with a "Allow

My customized EditForm.aspx which has a "People and Group" column with the "Allow multiple selections" property as "Yes" was working fine until the Agusust cumulative update was applied into the MOSS server. Now it's giving me the error: "An unexpected error has occurred". Needless to say, when I change the "Allow multiple selections" property to "No", the customized EditForm.aspx page works fine.Forgetting whyMicrosoft introduced this error for now, is there a workaround that you are awre of?

NetDataContractSerialization throwing deserialization error

hi, I have methods which return interface and some methods which accepts interface as parameters. I am trying to use Net DataContractSerializer but I am getting following error... The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:id. The InnerException message was 'Error in line 1 position 120. XML 'Element' 'http://tempuri.org/:id' does not contain expected attribute 'http://schemas.microsoft.com/2003/10/Serialization/:Type'. The deserializer has no knowledge of which type to deserialize. Check that the type being serialized has the same contract as the type being deserialized.'. Please see InnerException for more details. Please help me how to resolve this error.... If I use Netdatacontract attribute on Operation Contract, can i use DataContract and Datamember attribute on serializable class??? Thanks in advance...

SSIS package is giving error when ran thru JOB...its running good when I execute in BI Studio or Exe

Friends I am getting weird issue...I built an SSIS package. In one variable I used express builder and built like this... RTRIM( (DT_STR, 2,1252)  (((DT_I4) ( (DT_WSTR, 3) (SUBSTRING( @[system::machineName] , 12, 16 ))) +1) /2)) when I run the package outside ie., with VStudio or execute utility it running absolutely with out any problem. But when I created a job just to execute that package in particular timings...the job is totally failing by throwing error....the error output is like the following: Started:  10:22:33 AM Error: 2010-02-27 10:23:06.23    Code: 0xC00470C2    Source: Rerun_MissingFiles    Description: Error code 0x80020005 occurred attempting to convert from data type DT_WSTR to data type DT_I4. Error: 2010-02-27 10:23:06.23    Code: 0xC00470C4    Source: Rerun_MissingFiles    Description: Casting expression "(SUBSTRING( @[system::machineName] , 12, 16 )))" from data type "DT_WSTR" to data type "DT_I4" failed with error code 0xC00470C2. End Error Can any one help me please? Thanks in advance.

Giving me an error "Object reference not set to an instance of an object."

Hello Everyone, I am currently developing a website for online examination.  For that I have to collect user information at the time of registration. I want to develop a 3-tier application. I have SignUpWizard. Aspx page. I have also created 3 classes (Users.cs, UserDAL.cs and UserBAL.cs) and 1 stored procedure (InsertUserInfo).Code for Users.cs:using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Configuration; using System.Data.SqlClient; using System.Web.Security; using System.Data; namespace ITIL.DomainModels { public class Users { public int UserID { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string Username { get; set; } public string Password { get; set; } public string EmailAddress { get; set; } public string dateTime { get; set; } public string IPAddress { get; set; } public string SecurityQuestion { get; set; } public string SecurityAnswer { get; set; } } }Code for UserDAL.cs:using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Data; using System.Data.SqlClient; using System.Configuration; using ITIL.DomainModels; namespace ITIL.DAL { public class UserDAL { publi

Insert statement giving me syntax error


Good evening,


I have a MS Access table with the "ModelID" column set as AutoNumber and primary key. The ModelID is set as Field Size --> Long Integer, New Values --> Increment, Format --> General Number, Indexed --> Yes (No Duplicates).

Here is the code i am trying to execute, and is giving me an exception -> insert into syntax error:

string strInsert = "INSERT INTO tbl_Models (fName, lName, Image, Answer1, Answer2, Answer3, Answer4, Answer5, Votes, ImageHead, Age, Program, StudentID, PhoneNumber, EMail) VALUES (@fName, @lName, @Image, @Answer1, @Answer2, @Answer3, @Answer4, @Answer5, @Votes, @ImageHead, @Age, @Program, @StudentID, @PhoneNumber, @EMail)";
        OleDbCommand cmdInsert = new OleDbCommand(strInsert, myCon);

        cmdInsert.Parameters.AddWithValue("@fName", txtFirstName.Text.ToString());
        cmdInsert.Parameters.AddWithValue("@lName", txtLastName.Text.ToString());
        cmdInsert.Parameters.AddWithValue("@Image", FileUploadBody.FileName.ToString() + sRandomBody);
        cmdInsert.Parameters.AddWithValue("@Answer1", txtWhyBeAModel.Text.ToString());
        cmdInsert.Parameters.AddWithValue("@Answer2", "");
        cmdInsert.Parameters.AddWithValue("@Answer3", "

Error (no data returned) when ResponseFormat:=WebMessageFormat.Json and attempting to serialize an I


I have am having an issue when attempting to return JSON data from a WCF Service.  I have tracked the issue down to the ResponseFormat:=WebMessageFormat.JSON, but I am unable to make any further progress.  


I am wanting the return types of my service to be an interface so that I have a little more control over the responses that are coming to my application.  

I know that returning an interface requires the ServiceKnownType and requires KnowsType on the objects so that they can serialize properly.  I have an example working, however, when add a property with a class that inherits from iList things go bad.  The service returns nothing.  I have confirmed via Fiddler that the content-length of the response is 0.  However if I switch the ResponseFormat to WebMessageFormat.XML it works fine and all objects are returned.  I have included as much code (and probably more) as I think is necessary.  If something else is needed, let me know. 

Any insight is greatly appreciated.


Code Notes:

If you comment out the DataMember Attribute on the Values property in TestResult class you will see that the code works perfectly when returning JSON. 

If you change the return Type of the Values Property to be TestCollection instead of ITestCollection it works as well.  

SQL query giving Sytnax Error



 I have a query which I would like to execute however since im not a real specialist Im unable to find what is exactly wrong in it.

If anyone of the experienced DBAs could give me some tipos would be appreciated

(query is not mine - it has been created by someone else)


ALTER PROCEDURE dbo.CH_SyncClientSummary 
  declare @UTCdiff int 
  set @UTCdiff = DateDiff(mi, GetDate(), GetUTCDate()) 
  declare @currentsite varchar(3) 
  select @currentsite = ThisSiteCode from SMSData 
  Insert into CH_ClientSummary(MachineID) 
  Select MachineID 
  From MachineIdGroupXRef

New installation of SQL Server 2008R2 -Giving time out error


Hi all

I did side by side installation of SQL Server 2008 R2 RTM with no CU and I given a Alies name to the installation,until now applications working fine.Yester day SAN storage devices(iSCSI) are upgraded with new software.

after that I am getting an error

"Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. (Microsoft SQL Server, Error: -2)"

action required I found in Microsoft site is "Make sure that you have configured the firewall on the server instance of SQL Server to accept connections"

realy I don't know where I have configure this setting Please some help regarding

Thanks in Advance


Stored procedure giving strange error


I have as stored procedure which executes a dynamic SQL  at the end. The dynamic SQL inserts into a temporary table declared at the begining of the procedure. When i execute the proc, it executes for a while and then gives me a truncation error.

When i test the code witht out the proc, it works fine and come back with the result set. I am not able to figure out what culd be the issue.

Kindly assist me in this..I have tried setting all colum lenghts to very high values then required but still it does not work when i execute the proc.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend