Enterprise Configuration Block, SqlStorageProvider broken?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ben@peikes.com

    #1

    Enterprise Configuration Block, SqlStorageProvider broken?

    I've been trying to get this to work. Using the June 2005 release under
    Framework 1.1.

    I first set up the app.config so that my settings get saved to the
    registry. That works, so I know I'm using the EL configuration API
    correctly. I then used the EL Configuration program to switch to using
    a SqlStorageProvi der. When I attempt to save my settings I get a
    System.IndexOut OfRangeExceptio n.

    The table and two procedures in my database were created as follows:

    create table t_Configuration s
    (
    SectionName nvarchar,
    ApplicationName nvarchar,
    UserName nvarchar,
    MachineName nvarchar,
    GroupName nvarchar,
    ConfigSettings ntext
    )

    and two procedures

    create procedure p_Configuration _Get
    @sectionName as nvarchar
    as
    select ConfigSettings from t_Configuration s
    where SectionName = @sectionName
    go
    create procedure p_Configuration _Set
    @section_name as nvarchar,
    @section_value as ntext
    as
    update t_Configuration s
    set ConfigSettings = @section_value
    where SectionName = @section_name

    if(@@ROWCOUNT = 0)
    begin
    insert into t_Configuration s (SectionName, ConfigSettings)
    values( @section_name, @section_value)
    end
    go

Working...