Tuesday, April 23, 2013

Using Custom Configuration Sections in .Net client app

     I have a custom configuration I use in my ASP .Net programs that I wanted to use in some client programs.  However, when I tried to use it, I would get an error "Could not load configuration".  I found I needed to add one thing to my SectionGroup/Section Name entry:
[code]

      <sectionGroup name="ReportEmails" >
        <section name="ReportTest" type="SICommon.rptEmailConf,SICommon" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
      </sectionGroup>

[/code]

   The key piece is on the type definition. I needed to add the SICommon after SICommon.rptEmailConf.   This specifies the assembly name containing the custom configuration.  Without it specified, the system looked in the System.Configuration assembly and could not find it.

   


Wednesday, April 10, 2013

Listing Auto_Increment values in MYSQL Databases

  Here is a query to get the auto_increment values for tables in your databases.

[code]

 SELECT
table_schema,
table_name,
AUTO_INCREMENT,
table_rows,
information_schema.tables.*
FROM information_schema.TABLES
where
table_type = "base table"
and AUTO_INCREMENT is not null
and table_schema not like "%umbraco%"
and table_schema not like "%club"
and table_schema not like "%wi"

[/code]