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

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

How could I deserialize a object which is serialized in JAVA??

Posted By:      Posted Date: August 28, 2010    Points: 0   Category :.NET Framework
When I try to do it with the code below. FileStream fileStream = new FileStream( "C:\\apps\\user.tmp", FileMode.Open, FileAccess.Read, FileShare.Read);     BinaryFormatter bf=new BinaryFormatter();     pd = (PianoData)bf.Deserialize(fileStream);     System.Console.WriteLine();     fileStream.Close(); Exception occurred as I had excepted. "The input stream is not a valid binary format."   I wonder if I can do it by another way

View Complete Post

More Related Resource Links

JSON Deserialize into Entity Framework Object and setting the DataMemberAttribute "Name="




I'm in the process of deserializing a JSON object into an Entity Framework object.  The property names in the JSON do not match up totally with the property names in the Entity Framework Objects. What I'd like to do is set "Name=" on the  "DataContractAttribute" for the table and the "DataMemberAttribute" for the properties in the Designer.cs file.  I tried setting these in the Designer.cs file manually just to see if it would work - which it did (using JSON.Net) but of course when I went into the .edmx designer I lost all my changes.  Is there a way to do this?


Thanks in advance

How to: Serialize Hashtable contained inside another object that is serialized as an array of object

Update:  I've added the entire program in a single block of C# text near the end of these posts that can be placed into a C# Program.cs file of a console project.   I have a class called MyHashtable that inherits from Hashtable and implements IXmlSerializable.  MyHashtable is contained inside another object called MyObject and I need to xml serialize an array of MyObject[].  Whenever I xml deserialize, the hashtable is deserialized, but only 1 of MyObjects from the MyObject[] array is deserialized.  The ReadXml uses "while (reader.NodeType != XmlNodeType.EndElement)" so I don't think the reader is consuming all of the xml internally.   Does anyone know why this is happening?  Thanks.    

Deserialize JSON object in C#

Hi, I am new to JSON and one of my service is returning JSON object as a string to my application. I need to Deserialize JSON object in C#. My JSON string is in the current format. string str = "{\"candidates\":[{\"address\":\"1580 MARKET ST, SAN FRANCISCO, CA, 94102\",\"location\":{\"x\":-122.42054,\"y\":37.7745960000001},\"score\":40,\"attributes\":{}},{\"address\":\"1576 MARKET ST, SAN FRANCISCO, CA, 94102\",\"location\":{\"x\":-122.420355,\"y\":37.7747030000001},\"score\":40,\"attributes\":{}}]}"; Can anyone please help me how to get all the address, locations, score and attributes from the above string. Thankyou, Ravi.

Sharepoint Designer issue "could not deserialize object"?

Hi there, I'm relatively new to Sharepoint in general but I've got an install of Sharepoint Foundation and I'm working my way through the book "Sharepoint 2010 Development." At any rate, I'm trying to create a workflow in Visio 2010 and then export that workflow into Sharepoint Designer 2010. However, when I try to import the .vwi file into Designer, I get a "Could not deserialize object. The type 'Microsoft.Office.Workflow.Actions.ApprovalTaskProcess' could not be resolved." This, of course, is because in Visio I have a Start Approval Process object.  Is this particular workflow item not available for Sharepoint Foundation? Does anyone have any idea why I'm getting this error? Any feedback is appreciated. Thanks, Jearod

Timer job intiation error: SharePoint cannot deserialize an object of type

Hi All, when i run a timer job (One-Time timer) it has added it to Timer Job definitions in the Central Administration. I have checked the Log file in 12 hive and found the following error..... "SharePoint cannot deserialize an object of type xyz.xyzJob, xyzTimer, Version=, Culture=neutral, PublicKeyToken=<token> on this machine. This typically occurs because the assembly containing this type is not installed on this machine. In this case, this message can be safely ignored. Otherwise, the assembly needs to be installed on this machine in a location that can be discovered by the .NET Framework." The above error says that the assembly is not added.... but it has been already added to the GAC. Can anyone guide me about the issue and how to resolve that........?

'Object graph for type 'TYPE' contains cycles and cannot be serialized if reference tracking is d



I have datacontracts as below

  public abstract class ThisClass
    public abstract ThisClass Parent { get; set; }

  public class SomeClass: ThisClass
    public abstract ThisClass Parent { get; set; }


I tried solutions in below blogs


as well as I tried to apply ..[DataContract(IsReferece = true)]

But still i get below error message in SVC trace.

There was an error while trying to serialize parameter http://tempuri.org/:data. The InnerException message was 'Object graph for type 'SomeClass' contains cycles and cannot be serialized if reference tracking is disabled

Anybody has tried above scenario?

Please help, thanks in advance.

Regards, Nakul

How could Transfer a simple object that is created in asp.net to java script code and worked with it


Hi Experts.

I have a simple call in asp.net code behind. There are two variable i, j and some methods in . Like:

Class Test()

{              int i; string str;

                Public getI(int){//.}

Public getJ(int){//.}


Is there any way to have the same class in javascript? I want to create a simple object form this class and initiated its variables and passed it to javascript code and worked with it? How can I do it?


Object cannot be serialized because it does not have a parameterless constructor


I am creating a web service based on auto-generated classes from a schema compiler and all works well until I try to run the web service.  The service is:


[WebMethod(Description="Requester pings URL of EA to see if it is alive. Returns errorObject(s) as necessary to communicate application status.")]

[SoapHeader("MultiSpeakMsgHeader", Direction=SoapHeaderDirection.InOut)]

public errorObject[] PingURL()


return null;


The class code is:


public class errorObject : Altova.Xml.TypeBase


How to return serialized JSON object from WCF



I am able to return the JSON string from the wcf. But i want to return the JSON object from wcf.

Is is possible to return the JSON object from the wcf? If yes , then how?


Thanks in advance..... 

Thinking about new C# method prototypes: object as dictionary

I recently had to write a small Flickr API. I know many .Net API for Flickr already exist but I needed one for a Silverlight application. Whatever, it's only about building some querystrings so I did it by myself. It's been an opportunity to think again about a classical question: how to pass parameters to a method ?

Imagine you have a generic method to call some Flickr functions.

C# Object Oriented Programming

So far in C# Essentials we have looked at the basics of programming in C# such as variable types and flow control. Although it would be possible to write a functional program using these techniques, there is much more to becoming a proficient C# programmer. C# is, above all, an object oriented programming language and as such any C# programmer will be expected to create object-oriented applications using this language.

Object Oriented Programming

Four core concept of OOP Object Oriented Programming. 1.Inheritance, 2.Polymorphism, 3.Abstraction and 4.Encapsulation

Object-Oriented Programming Concepts

This is the first in a series of articles describing the use of object-oriented programming techniques as implemented by the C# programming language. This series follows the C# Fundamentals tutorial that beginners are advised to read first.

Overview of SharePoint Object Model

SharePoint offers a set of structured server-side objects those are widely used to program SharePoint Applications. These objects are hierarchically arranged and you can drill down through the object hierarchy to obtain the object that contains the components of SharePoint Application you need to use in your code.

What is the difference between "dynamic" and "object" keywords?

Let's take a quick look at the object keyword first. I'm not going to talk a lot about it because it's been around since C# 1.0. This keyword is nothing more than a shortcut for System.Object, which is the root type in the C# class hierarchy. (However, as Eric Lippert pointed out in his blog post, not everything in C# derives from object.) This is a powerful mechanism, since you can assign almost any value to instances of this type.

How to bind GridView and DropDownList controls using DataTable object

In .net framework 2.0, you can load a DataTable in memory by consuming a data source using a DataReader. In this version you will find the flexibility in accessing the DataReader means write access code once and use again and again using DataReader. To see the functionality of DataTable consider an example that is created using VS2005.

Jscript error: Object does not support property or method


 Hi, i have little knowledge on javascript but i need to use this code get from somewhere for a jquery to work.

I face this "Jscript runtime error: Object does not support property or method" whenever im trying to run this page.

In my experience, im get this error msg 9 out of 10 times i use javascript in my system.

Im using Microsoft Visual web developer 2008, i wonder if this is related to my problem, i not sure there is anything i need to add as reference or update anything.

But anyway, in short, i just couldn't use javascript code when using this development tool because of this sort of error.

Anyway, it happen that last time i tried use the same type of jquery code in another project and it seems to work well without an error.

But now when im try to use it again in this recent project i created, it come out with this error and i have no idea how to solve it even look through google and this forum.

It doesn't really seems like its the code problem itself although im not sure, because any javascript code just couldn't work.

So below is my code that i need to use.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script>
<script type="text/javascript" src=&quo
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