Click here to Skip to main content
15,900,511 members
Home / Discussions / C#
   

C#

 
AnswerRe: handling unicode Pin
Malli_S22-Feb-06 1:45
Malli_S22-Feb-06 1:45 
GeneralRe: handling unicode Pin
cshivaprasad22-Feb-06 2:19
cshivaprasad22-Feb-06 2:19 
AnswerRe: handling unicode Pin
Christian Graus21-Feb-06 17:56
protectorChristian Graus21-Feb-06 17:56 
GeneralRe: handling unicode Pin
Le centriste22-Feb-06 1:22
Le centriste22-Feb-06 1:22 
Questionwhy do i get "object reference not set to an instance of an object" Pin
aqui_i21-Feb-06 16:07
aqui_i21-Feb-06 16:07 
AnswerRe: why do i get "object reference not set to an instance of an object" Pin
Christian Graus21-Feb-06 16:15
protectorChristian Graus21-Feb-06 16:15 
QuestionAbout Windows Service. Pin
tianwei0221-Feb-06 16:04
tianwei0221-Feb-06 16:04 
Questiondeserialize to C# class from external config file? Pin
Tom Paluzzi21-Feb-06 15:50
Tom Paluzzi21-Feb-06 15:50 
I'm using System.Configuration in .NET 2.0 to load in values
from an externally specified config file and deserialize
them into a C# class. During deserialization, I'm getting
an exception thrown by .NET It's having a problem with
the <connections> element seen below. I've tried different things, but
still I can't get the deserialize to succeed. Here's the problem in
detail below.

Can anybody tell me what I'm doing wrong? Shouldn't
[xmlArray] work?

Thx,
Tom

The app.config file looks like this:

<configuation>
<configSections>
<section name="dataAccessSection" type="Framework.Data.DataAccessConfig,Framework.Data,Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null"/>
</configSections>

<dataAccessSection configSource="DataAccess.config"/>
</configuation>

DataAccess.config looks like this:

<dataAccessSection>
<connections>
<connection name="fsa">
<connectionEnvs>
<connectionEnv envName="INT1" assembly="System.Data, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="System.Data.OleDb.OleDbConnection" connectionString="Provider=OraOLEDB.Oracle;Password={0};Persist Security Info=True;User ID=fiisbsvc;Data Source=dbenv022" connectionStringPassword="lttC8Hg29Nfks+3QPI8Hxg==">
</connectionEnv>
</connectionEnvs>
</connection>
</connections>
<commands/>
<maps/>
</dataAccessSection>


The C# class looks like this:

using System;
using System.Xml.Serialization;
using System.Configuration;

namespace Framework.Data
{
/// <summary>
/// Represents the root of all data access configuration information.
/// </summary>
public class DataAccessConfig : ConfigurationSection
{
#region Constructor(s)

/// <summary>
/// Initializes a new instance of the <see cref="DataAccessConfig"/> class.
/// </summary>
public DataAccessConfig()
{
_sectionName = _defaultSectionName;
}

#endregion

#region Config Manager
private const string _defaultSectionName = "dataAccessSection";
private string _sectionName;

#region Connection Config

private ConnectionConfigCollection _connections = new ConnectionConfigCollection();

/// <summary>
/// Gets or sets the collection of connection configuration items associated with this application.
/// </summary>
/// <value>The collection of connection configuration items associated with this application.</value>
[XmlArray("connections")]
[XmlArrayItem("connection")]
// [ConfigurationProperty("connections")]
// [ConfigurationCollection(typeof(ConnectionConfigCollection))]
public ConnectionConfigCollection Connections
{
get
{
return _connections;
}
set
{
_connections = value;
}
}
.
.
.
}
QuestionUgh! Property Grid Pin
gantww21-Feb-06 14:01
gantww21-Feb-06 14:01 
QuestionNeed Help Creating Pop Up WinForm Pin
ilan_dalal21-Feb-06 11:55
ilan_dalal21-Feb-06 11:55 
AnswerRe: Need Help Creating Pop Up WinForm Pin
KaptinKrunch21-Feb-06 12:17
KaptinKrunch21-Feb-06 12:17 
QuestionRe: Need Help Creating Pop Up WinForm Pin
ilan_dalal21-Feb-06 23:49
ilan_dalal21-Feb-06 23:49 
AnswerRe: Need Help Creating Pop Up WinForm Pin
ilan_dalal22-Feb-06 2:25
ilan_dalal22-Feb-06 2:25 
QuestionVertical alignment of text WITHOUT rotating graphics object Pin
buelentc21-Feb-06 11:43
buelentc21-Feb-06 11:43 
AnswerRe: Vertical alignment of text WITHOUT rotating graphics object Pin
Judah Gabriel Himango21-Feb-06 13:32
sponsorJudah Gabriel Himango21-Feb-06 13:32 
QuestionHow to Print a Page in Visual Studio 2003 by using C# ? Pin
Abubakarsb21-Feb-06 11:42
Abubakarsb21-Feb-06 11:42 
QuestionHow to use OpenGL in c# ? Pin
hdv21221-Feb-06 11:38
hdv21221-Feb-06 11:38 
AnswerRe: How to use OpenGL in c# ? Pin
Judah Gabriel Himango21-Feb-06 11:55
sponsorJudah Gabriel Himango21-Feb-06 11:55 
QuestionHow to Check For Network Connection? Pin
cyrus_thevirus21-Feb-06 11:32
cyrus_thevirus21-Feb-06 11:32 
AnswerRe: How to Check For Network Connection? Pin
gnjunge21-Feb-06 23:36
gnjunge21-Feb-06 23:36 
QuestionObject Binding - RDLC report (nested obj's) Pin
Susan Hernandez21-Feb-06 9:59
Susan Hernandez21-Feb-06 9:59 
QuestionCompare 2 digits Pin
cppdotnet21-Feb-06 9:34
cppdotnet21-Feb-06 9:34 
AnswerRe: Compare 2 digits Pin
Guffa21-Feb-06 10:07
Guffa21-Feb-06 10:07 
GeneralRe: Compare 2 digits Pin
cppdotnet21-Feb-06 10:31
cppdotnet21-Feb-06 10:31 
QuestionTristate checkboxes in TreeView? Pin
Luis Alonso Ramos21-Feb-06 9:26
Luis Alonso Ramos21-Feb-06 9:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.