473,763 Members | 6,772 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

case sensitive hashtable corss framework serialization

hi there,
has anyone had success in serializing a 2.0 case sensivite hashtable
ie.
private Hashtable m_itemsById = new Hashtable(
new CaseInsensitive HashCodeProvide r(),
new CaseInsensitive Comparer());

And deserializing it in 1.1?

It doens't work, and a serialization exception is thrown indication that
System.Globaliz ation.TextInfo has 5 members (2.0) where only 3 are expected
(1.1)

Anyone got a solution to the problem above?

thanks in advance
Brian
Nov 17 '05 #1
2 1673
Brian,

You aren't really going to be able to do that. Instead of serializing
the hashtable, why not create a type that stores keys and values, and create
a new hash table when you try and de-serialize the object?

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Brian Keating" <Br**********@d iscussions.micr osoft.com> wrote in message
news:F3******** *************** ***********@mic rosoft.com...
hi there,
has anyone had success in serializing a 2.0 case sensivite hashtable
ie.
private Hashtable m_itemsById = new Hashtable(
new CaseInsensitive HashCodeProvide r(),
new CaseInsensitive Comparer());

And deserializing it in 1.1?

It doens't work, and a serialization exception is thrown indication that
System.Globaliz ation.TextInfo has 5 members (2.0) where only 3 are
expected
(1.1)

Anyone got a solution to the problem above?

thanks in advance
Brian

Nov 17 '05 #2
HI Nic,

I considered this option however serialization occurrs alot so maybe not so
good an option.
Another option i considered was implementing my own CaseInsensivite HashCode
provider and CaseInsensivite Comparer but need to look more into it to see
what's involved.

There is a good chance our server will be ported to beta 2.0 when released
so maybe i'll just ignore the problem for time being and use the "New
Recommendations for Using Strings in Microsoft .NET 2.0".

thanks for your time
brian

"Nicholas Paldino [.NET/C# MVP]" wrote:
Brian,

You aren't really going to be able to do that. Instead of serializing
the hashtable, why not create a type that stores keys and values, and create
a new hash table when you try and de-serialize the object?

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Brian Keating" <Br**********@d iscussions.micr osoft.com> wrote in message
news:F3******** *************** ***********@mic rosoft.com...
hi there,
has anyone had success in serializing a 2.0 case sensivite hashtable
ie.
private Hashtable m_itemsById = new Hashtable(
new CaseInsensitive HashCodeProvide r(),
new CaseInsensitive Comparer());

And deserializing it in 1.1?

It doens't work, and a serialization exception is thrown indication that
System.Globaliz ation.TextInfo has 5 members (2.0) where only 3 are
expected
(1.1)

Anyone got a solution to the problem above?

thanks in advance
Brian


Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2027
by: André Giesing | last post by:
Hello NG! I've got a short question: Is there a difference of the internal representation of a Hashtable between the Compact Framework and the normal Framework? I've got the suspicion, because when I Serialize the same Object (with a Hashtable in it) on a Computer with the normal .NET Framework and on a mobile Device (which uses the Compact Framework) the byteStream is different!
3
1288
by: A. Burch | last post by:
I'm wanting to use a Hashtable. I have 2 (keys, objectvalues) pairs of data to store. I'm using a static declartion for the Hashtable the instance of the class that is the object. If I try and retreive the first object after storing after the 2 (key, objectvalues) are stored I always get the last object value stored. Why doesn't qrec = (Q)HT give a copy of the last or in this code the second of the 2 objects? How should the code be...
1
8716
by: francois | last post by:
Hi, I have a webservice that I am using and I would like it to return an XML serialized version of an object. the class of the object is defined serializable as the following: public class Event {
5
2826
by: francois | last post by:
First of all I would to to apologize for resending this post again but I feel like my last post as been spoiled Here I go for my problem: Hi, I have a webservice that I am using and I would like it to return an XML serialized version of an object.
10
7137
by: LP | last post by:
Hi, I was asked at the tech screening what the linked list was which I answered with "academic" definition. Then a guy asked me how I would implement a linked list in C# and what would be a good case for linked list. I could not think of any .NET class that implement true linked list (I don't think there is any). But, I guess one could implement their own linked list. I couldn't think of a good case when it would be absolutely necessary...
1
2338
by: oDDskOOL | last post by:
I realized today that the Hashtable.Clone only produces a shallow copy... that makes me go mad that M$ doesn't even provide a deep copy ctor for the Hashtable class ! mighty tech ducks might reply "oh but what if the types in hastable don't have copy ctors defined? that could lead to dangerous situations". well, but was it a significant effort to provide a copy ctor / deep clone method to this class for objects that provide the...
1
6987
by: Boban Dragojlovic | last post by:
Say I have a dropdownlist control of the US State Codes <asp:dropdownlist id=ddlStateCode ...> <asp:listitem value="AL">Alabama</asp:listitem> <asp:listitem value="CA">California</asp:listitem> etc... In my codebehind, I have something like this: ddlStateCode.SelectedValue = UserRecord.StateCode
5
2689
by: Dick | last post by:
Hello, I'm trying to serialize a class with a Hashtable within: ' Class code: Imports System.Collections Class clsOptions Public countID As Integer Public persons As New Hashtable End Class
11
6257
by: Rafe | last post by:
Hi, I'm working within an application (making a lot of wrappers), but the application is not case sensitive. For example, Typing obj.name, obj.Name, or even object.naMe is all fine (as far as the app is concerned). The problem is, If someone makes a typo, they may get an unexpected error due accidentally calling the original attribute instead of the wrapped version. Does anyone have a simple solution for this?
0
9563
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10144
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9997
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9937
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7366
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3522
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2793
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.