Error Number from System.Exception

Error Number from System.Exception

Post by Brian Ree » Wed, 11 Sep 2002 07:54:05



How do I access the ErrorNumber from a System.Exception object?  I can see
that there is an HResult protected member, but I cannot access it directly.

Any thoughts?

Brian

 
 
 

1. Unhandled Exception: System.Configuration.ConfigurationException: Could not create System Configuration.NameValueSectionHandler, System

Hi,All:
    I got an exception:
    Unhandled Exception: System.Configuration.ConfigurationException: Could
not create System     Configuration.NameValueSectionHandler, System
when reading my configuration file

Any ideas?
Thanks in Advance
John

using System;
using System.Configuration ;
using System.Collections.Specialized ;
class Test
{
    public static void Main()
    {
         {

     NameValueCollection d =

(NameValueCollection)ConfigurationSettings.GetConfig("MyGroup/bshEmail");
  if (d!=null) {
      foreach(String key in d )
   Console.WriteLine(d[key]);
  }
  else
   Console.WriteLine("N/A");

        }
    }

Config File.
<configuration>
   <configSections>
  <sectionGroup name="MyGroup">
     <section name="bshEmail"
type="System.Configuration.NameValueSectionHandler, System"/>
  </sectionGroup>
   </configSections>
   <MyGroup>
   <bshEmail>
 <add key="mailServer" value="mail.aperto.de" />
   </bshEmail>
   </MyGroup>
  <appSettings>
    <add key="pubs" value="server=(local);database=pubs;user id=sa;pwd=" />
    <add key="pubs1" value="1server=(local);database=pubs;user id=sa;pwd="
/>
    <add key="pubs2" value="2server=(local);database=pubs;user id=sa;pwd="
/>
    <add key="pubs3" value="3server=(local);database=pubs;user id=sa;pwd="
/>
    <add key="pubs4" value="4server=(local);database=pubs;user id=sa;pwd="
/>
    <add key="pubs5" value="5server=(local);database=pubs;user id=sa;pwd="
/>
    <add key="pubs6" value="6server=(local);database=pubs;user id=sa;pwd="
/>
  </appSettings>
</configuration>

2. POP3 Connector For Exchange

3. The Error: Number of indices is less than the number of dimensions of the indexed array.

4. 4019 IBM laser on Pentium/Win95 problem

5. exception:System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 error

6. Serial Port Pinout

7. System.Security Exception error

8. ActiveHome CM11A beta

9. Error - Exception of type System.InvalidCastException was thrown !!!!

10. System. NullReference Exception error

11. (DropDownList DataBindig Error)An exception of type System.InvalidCastException was thrown.

12. An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll