473,394 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

XmlSerializer

jon
Hi,

I have a problem using the XmlSerializer when I switch between two
databases (SQL Server and Oracle). Very puzzling!

If my app is set for SQL Server it works fine. Basically the app has
an object model which is serialized (using the XmlSerializer) and
stored in a database table.

If I then change the configuration to Oracle the following line of code
does not work:

XmlSerializer serializer = new XmlSerializer(typeof(DebtorCycles));

The exception is as follows:

System.TypeInitializationException: The type initializer for
"System.Xml.Serialization.Compiler" threw an exception. --->
System.Configuration.ConfigurationException: Unrecognized configuration
section DBType (C:\Documents and Settings\myuser\Desktop\New
Folder\ArrearsUI.exe.config line 4)
at
System.Configuration.ConfigurationRecord.ScanSecti onsRecursive(XmlTextReade*
r
reader, String configKey)
at System.Configuration.ConfigurationRecord.Load(Stri ng filename)
at System.Configuration.DefaultConfigurationSystem.En sureInit(String
configKey)
at
System.Configuration.DefaultConfigurationSystem.Sy stem.Configuration.IConfi*
gurationSystem.GetConfig(String
configKey)
at System.Configuration.ConfigurationSettings.GetConf ig(String
sectionName)
at System.Diagnostics.DiagnosticsConfiguration.GetCon figTable()
at System.Diagnostics.DiagnosticsConfiguration.Initia lize()
at System.Diagnostics.DiagnosticsConfiguration.get_Sw itchSettings()
at System.Diagnostics.Switch.Initialize()
at System.Diagnostics.Switch.get_SwitchSetting()
at System.Diagnostics.BooleanSwitch.get_Enabled()
at System.Xml.Serialization.Compiler..cctor()
--- End of inner exception stack trace ---

Now as you can see, there's a line in the exception text that states:

"Unrecognized configuration section DBType"

DBType is a setting in an app.config file but this file is only parsed
when the initial form loads and I've ensured the XmlTextReader I'm
using is closed.

Help appreciated.
Nov 17 '05 #1
0 2293

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

Similar topics

4
by: Zion Zadik | last post by:
Dear all, I have a set of c# data classes which i need to fill their data from xml files. serialization looks to be the best way to accomplish this task. Since the data classes are compiled and...
5
by: Stuart Robertson | last post by:
I am trying to find a solution that will allow me to use XmlSerializer to serialize/deserialize a collection of objects where a given object is shared between two or more other objects, and not...
1
by: Bluetears76 | last post by:
Hi I have a hirachy of classes which are Message(base), then FileMessage and ChatMessage (extended) I want to serialize the objects and when i am deserizaling i dont know if i am getting...
3
by: Anthony Bouch | last post by:
Hi I've been reading using the XmlSerializer with custom collections. I've discovered that when serializing a custom collection (a class that implements ICollection, IList etc.) the...
4
by: Andy Neilson | last post by:
I've run across a strange behaviour with XmlSerializer that I'm unable to explain. I came across this while trying to use XmlSerializer to deserialize from a the details of a SoapException. This...
3
by: Loui Mercieca | last post by:
Hi, I have created a class, named FormField , which basically contains two fields, name and value. I have set the tag before the class and the field is set as an XmlAttribute whil the name as...
12
by: SJD | last post by:
I've just read Christoph Schittko's article on XmlSerializer: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxmlnet/html/trblshtxsd.asp . . . and very informative it is too....
4
by: Steve Long | last post by:
Hello, I hope this is the right group to post this to. I'm trying to serialize a class I've written and I'd like to be able to serialze to both binary and xml formats. Binary serialization is...
0
by: William Stacey [MVP] | last post by:
Had a method that got some string info from mp3 tags in N files and serializes this class and deserializes at other side. Works ok except sometimes get chars that choke the XmlSerializer. After...
3
by: kimtherkelsen | last post by:
Hi, I want to send XML data from a server to some clients over a network connection using the TCP/IP protocol. If I send the XMLs as byte arrays I need to insert header information in the data to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.