Class Serialization - No Results Returned

Jun 16, 2011

I have an error in the the following class, but am unsure where it is. The class will return correctly in my service but does not serialize and return any results.

Imports System
Imports System.Data.Objects
Imports System.Data.Objects.DataClasses
Imports System.Data.EntityClient
Imports System.ComponentModel
Imports System.Xml.Serialization
Imports System.Runtime.Serialization
[Code] .....

This will not be the final iteration of GetEmail, but I am using this in it's current state to try and figure out why I am not getting the class to serialize correctly.

View 1 Replies


ADVERTISEMENT

Not All Results Returned From ADODB Connection?

Jun 1, 2010

We have had a visual basic.net (2002) service running on our server for several years now with no problems. However I recently needed to update one of the DB calls by adding additional fields to the SELECT statement. However, after adding the new fields, some of the returned data is coming back empty when I loop through the records. I have confirmed that the querystring is accurate and returns all of the data through a third party viewer, so I'm not sure what is going on.For example, in the code below, everything worked fine with field1, field2, and field3. However, when I add field4, data for field2 and field4 come back empty when looping through the results.

View 10 Replies

C# - NHibernate - Default Implementation Of QueryOver Use Some Sort Of Caching When The Results Are Returned?

Dec 15, 2010

I am developing a windows forms smart client that uses Fluent Nhibernate 1.1 and NHibernate 3.0 for persistence. Due to legacy code I have had no option but to create a single session that handles all client level CRUD operations. This tends to leave the Nhibernate session in a stale state. So I have made the decision to use QueryOver to eliminate this stale data issue, as I was under the impression that query results were not cached. This doesn't seem to be the happening as the results returned from NHibernate seem to be cached. My question is does the default implementation of QueryOver use some sort of caching when the results are returned?

View 1 Replies

XML Serialization Of Array Of Class Within Class?

May 8, 2012

In short, I can't seem to get the xml serializer to serialize an array of one class type embedded within an array of another class.I have two classes, one of which contains an array of the other class, as follows (there are other objects in the classes that I've not included):

[Code]...

There must be a simple way to get the XML serializer to serialize the array of the class embedded within the array of the class that I am serializing. Am I missing something?

View 5 Replies

Any Disadvantage Of Serialization Of Class?

Jul 2, 2010

I want to know the disadvantage of serialization of a class in vb.net. As I am using it for deep copy only. Is it correct or not?

View 3 Replies

Serialization Class Won't Compile

Mar 17, 2010

I'm trying to make this work here is the code it's quite simple the serialization work's though the deserialization dosen't.[code]...

View 2 Replies

Serialization For A Class Declared As WithEvents

May 9, 2009

Public WithEvents Tree as Tree. I am not able to Serialize the Tree class, but if i remove the "WithEvents" keyword, it works fine. Why? What should I do if I have to declare it with "WithEvents"?

View 2 Replies

VS 2010 - Saving Class To File Via Serialization?

Feb 13, 2012

I am having trouble saving a class to a file via Serialization. I am getting this error:
Type 'System.Drawing.Graphics' in Assembly 'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not marked as serializable.

I have changed the:
Public Class cJigsaw
to:
<Serializable()> Public Class cJigsaw
The next line in my class is:
Public img As Bitmap

I tried adding the <Serializable()> attribute to this code, yet it has this error:
Attribute 'SerializableAttribute' cannot be applied to 'img' because the attribute is not valid on this declaration type.

View 6 Replies

C# - How To Ignore Event Class Member For Binary Serialization

Mar 5, 2010

I need to avoid serializing an Event class member because when the event is handled by an object that is not marked as Serializable the serialization will fail.

I tried using the NonSerialized attribute on the Event class member but it fails to compile. This line of code:<NonSerialized()> Public Event PropertyValueChanged()

produces the following error: Attribute 'NonSerializedAttribute' cannot be applied to
'PropertyValueChanged' because the
attribute is not valid on this
declaration type.

Public Event PropertyValueChanged() ' compiles but needs the extra handling described below

Is there another way to avoid serializing Event members? This is not a problem if the event is not handled and I can work around it by cloning the objects (and ignoring the event) before serializing them. Just wondering if there is a better way.

View 3 Replies

OOP - Declare Two Datatables And Fill Them Both From A Datatable Returned By A Function In Class

Sep 27, 2010

When I declare two datatables and fill them both from a datatable returned by a function in class, that when i filter the one it seems to filter the other aswell?

For example:

I declare the datatable and initiate my class:

Dim DatatableOne As New Datatable
Dim DatatableTwo As New Datatable

Dim MyClass As New MyClass

I then call the function that returns a datatable and apply it to datatable1 and 2 Then fill two DataGrids with the table:

DatatableOne = MyClass.GetTable()
DatatableTwo = MyClass.GetTable()

DatatableOne.DefaultView.RowFilter = "Name = 'Tom'"

[CODE]...

For some reason i don't understand but both grids end up with the filtered data?

View 3 Replies

Serialization Missing Dot Right Before New Line Serialization

Sep 17, 2009

I've been using XML serialization for a while, and today I realized something really odd. If I have a new line right after a "dot" (.), when i deserialize, I lose the dot. Has anyone ever had this happen to them? The following is my serialization code:

[Code]...

View 2 Replies

Assigning Results To Base Class Properties

Apr 26, 2009

I have a base class where amongst other code I have declared 2 properties. In my derived class, I get data from the DB and assign the results to the base class properties. This is so when I go back to the base class code, I can access the property values. It allows me to set the values in the derived class but once I go back to the Base class, the values don't exist.

Snippets of code sample:
base class:
Public Class ServiceProcessor
Private mSalesOrderID As Integer = 0
Private mName As String = ""
Friend Property SalesOrderID() As Integer
[Code] .....

View 6 Replies

IDE :: Importing A Type Lib With A Module Results In Empty Class?

Oct 27, 2011

We have a typelib where we define some constants. One of our sets of constants is created using the module keyword:

module MyConstants
{
const int Const1 = 1;
};

I use tlbimp.exe in a bat file to generate a primary interop assembly for internal use.If I create a VB .net project and add a reference and browse to the .tlb file and import it, the result I see in the browser window is a class named MyConstants. If I click the class, the right hand pane is empty - the class contains absolutely nothing.

If I add a reference to the primary interop assembly, I also see the class MyConstants int he browser window. When I click the class, the constants show up.This is in Visual Studio 2010 (RTM). Why does VB .NET add reference via brwose to the .tlb file differ in this case? Is this a bug in VB .NET or the tlbimp.exe tool?

View 8 Replies

Varying Display Results Based On Selected Device Class

Mar 15, 2012

I wanted to get your feedback on a design/coding issue. I have a treeview which represents the device tree in device manager. I also have two listviews which display information about the currently selected device on the treeview. I'm only concerned with the first listview at this point. The information displayed in the listview varies depending on the selected device. I'm using the node index to track which device class and device is selected and I pass this into the device class Display method. I hate the idea of a big Select Case statement. Then there is also the dynamic nature of the device tree to consider.

View 2 Replies

Asmx Json Serialization Versus Wcf Json Serialization?

Nov 24, 2011

I have two experimental web services. One is an asmx contained within a .net web application. The other is a WCF service library being invoked from the web application.The asmx basically does everything I need, but I think WCF would be better, except that it doesn't do anything as I would expect after fiddling with the asmx service.For example, the same method behaves differently in each:

' ASMX
<WebMethod(BufferResponse:=True, EnableSession:=False)>
Function Test(aObject as Object) as Object
' object will have been successfully serializaed into a dictionary

[code]...

View 3 Replies

Show The Final Results Instead Of The Results Real-time

Sep 28, 2010

I have a form that allows users to select file and then it reads the contents, parses the data and then executes a sql insert statement to add it to a database. What I am having issues with is showing real-time results. Currently, I have the import operation take place on the import form within the OnLoad event. The problem with this is it only shows the final results instead of the results real-time. Is there anyway to do this without creating a seperate thread and delegates?

View 1 Replies

C# - XML Serialization In .NET?

Oct 3, 2011

I have xml like this:

<?xml version="1.0" encoding="utf-8"?>
<session xmlns="http://winscp.net/schema/session/1.0" name="blah@blah.com" start="2011-10-03T15:09:30.481Z">
<ls>

[code]....

Why is XMLSession.FileList.Count always 0. I hypothesize it has something to do with the declaration above it but I am not sure what is wrong with it. Maybe it can't accept a path, if not, how can I do it?

View 2 Replies

C# - .Net XML Serialization Based On A XSD?

Oct 20, 2009

I've been serialising and deserialising .net objects using the XmlSerializer class without problem, however we now need somebody else to look at that data to perform some analysis on it.In order to help with that we've produced an XSD based on our class like so:

xsd.exe /t:DataClass Assembly.exe

The start of the XSD looks like this:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="DataClass" nillable="true" type="DataClass" />[code].....

Bizarly, the XML produced does not adhere to the XSD generated from the same class.My question then is, is there a way of telling the XmlSerializer to serialize the object based on a given XSD? As an aside, I've looked at other ways of fixing this: I've tried re-generating the classes from the generated XSD - this seemed to have the same problem.

View 1 Replies

Serialization Using XML File?

Sep 13, 2010

I have a MRU list that keeps on clearing when I close my application. In order to keep this information, I am trying to serialize it to an xml file, however, I can't figure out how to get the list written to this xml file.

Class
<Xml.Serialization.XmlRoot(ElementName:="Class_mrulist")> _
Public Class MRULIST

[Code]....

View 5 Replies

VS 2005 Serialization In XML?

May 20, 2010

I have been working hard with the XML for a couple of days.And when i came to serialization;what the the actual need of Serialization in XML? [URL]

View 8 Replies

C# - Serialization Across Projects With Inheritance?

Jul 19, 2010

I have a base class ("MyBaseClass") in a project called "BaseFramework" which is included in several solutions within the company. There are several derived class's in various projects throughout the company that inherit from "MyBaseClass". If I then create a List and add derived class's to it, it will not serialize. I realise that if I were attempting to serialize this list, and the base class and derived class were in the same project, I could simply apply the "XmlInclude" attribute to the base class and include all of the derived class's. This is however not possible across projects, because that would require a circular dependency.

View 1 Replies

C# - XML Serialization Assembly For Non-web Projects

Mar 19, 2012

I am attempting to solve the well known problem of automatically generated serialization assemblies in VS 2010, both VB.NET and C#. The "Generate Serialization Assemblies" option in project settings does nothing for non-web projects (see [URL]). Thus the calls to serializers generate file i/o exceptions that are very unfortunate, and for which there is no cure. The method suggested above does not appear to work with VS2010 and SGEN still runs with /proxytypes enabled.

View 1 Replies

DataContract XML Serialization And XML Attributes With .NET?

Oct 21, 2011

DataContract XML serialization and XML attributes which is most interesting I have attempted to directly convert it to VB.NET, but it does not seem to give me the right results. All I get is the root element with no attributes:

<root xmlns="http://schemas.datacontract.org/2004/07/shutlBookingService" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"/>

how to add attributes to an element using VB.NET

OK Here's the code:

<ServiceContract()>
<AspNetCompatibilityRequirements(RequirementsMode:=AspNetCompatibilityRequirementsMode.Allowed)>
<ServiceBehavior(InstanceContextMode:=InstanceContextMode.PerCall)>
Public Class Service1

[code]....

The output is:

<Test xmlns="http://schemas.datacontract.org/2004/07/shutlBookingService" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><success>0</success><timestamp>2011-10-22T09:28:52.7884244+01:00</timestamp></Test>

Which as you can see does not have success and timestamp as attributes.

View 2 Replies

De-serialization Of XML In Visual Basic?

May 26, 2011

I am creating a new windows program and I have used XML serialization to save the contents of my text boxes but when I try to open that file in the new application, no data is transferred. The code acts like it does everything fine and does not give me any errors, it just doesn't input the text back into the program.

Here is my code:

Imports System.Xml.Serialization
Imports System.IO
Imports System.Runtime.Serialization.Formatters.Soap

[Code].....

View 4 Replies

Serialization And Deserialization Of An Interface?

Jun 18, 2012

how to serialize and deserialize an interface.

View 1 Replies

Serialization And Encrypting Files?

Jan 15, 2010

what the relation between Serialization and encrypting files, i wanna know that and i wanna a lessons for serialization and i want to ask about this code in VB6 if we can convert it to VB.net 2008

Dim a As String * 10
Dim b As String * 10
Dim c As String * 10

[code]....

View 1 Replies

Serialization Of Panels Controls?

Sep 5, 2009

I am new at this. Im trying to serialize a panel and its contents in vb. The controls are added at runtime. I have tried adding to a arraylist but it didnt work

View 2 Replies

Serialization Suddenly Slow - How To Fix It

Jun 11, 2009

I've been cloning my objects using serialization for awhile, and typically its been quick, at least for my purposes. After a series of updates to these objects, however, now the serialization process is much slower. Trial-and-error has so far failed to pinpoint the cause. Some of the added elements to my object are:

1.binding lists

2. an inherited dictionary class

3. more internal references (the object is actually group of nested objects, and these internal objects have more references to each other than before)

I have been careful to avoid/eliminate references to external elements when cloning, as that can lead to a cascade of extra cloning. So I think the problem is with the object structure itself. This is my serialization routine:

Friend Function CloneObj(ByVal obj As Object) As Object
If Not obj.GetType.IsSerializable Then Throw New Exception("Object not serializable")
Dim bf As New System.Runtime.Serialization.Formatters.Binary.BinaryFormatter

[code]....

View 4 Replies

Serialization To A Textbox/richtexbox?

Nov 6, 2010

I found a source code that serializes an object and save it to a textfile, here it is:

saffa
Dim save As New SaveFileDialog()
save.Filter = "Text files only ( *.txt )|*.txt"

[code].....

View 6 Replies

Use A .bin From A Serialization In Two Different Application From Two Different Projects

Mar 19, 2010

I tryed using serialization I might be using the wrong thing though what im trying to do is to serialize a class to a .bin file and then use it from another application, is there a way to change the specification of the binary formater this way it works in two different Vb.NET projectS??

[Code]....

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved