Problem in Creating Database Through Enterprise Library 2.0

Discussion in 'General Computer Support' started by rao.kamran, Apr 14, 2009.

  1. rao.kamran

    rao.kamran

    Joined:
    May 11, 2007
    Messages:
    2
    Hi,

    I am having problem in trying to create database from my DataAccessLayer (DAL) using MS Enterprise Blocks 2.0. My application architecture is as follwos

    1- MyService (WindowsService)
    2- Business Entities Layer
    3- Business Logic Layer
    4- DataAccessLayer (DAL)

    My only app.config is in root of my MyService project and setting.settings is in properties folder. When i try to create db i get the error
    {" The type initializer for 'Microsoft Practices EnterpriseLibrary Common Configuration ObjectBuilder.EnterpriseLibraryFactory' threw an exception "}
    I have copy pasted the config file and renamed its name spaces properly.

    I have basically two project with the same architecture. In one project i can interact with database properly.
    CODE:

    public void GetOASList(OASLiveToSanboxDataSet dsOAS, string Version)
    {
    Database dbDSS = CreateDSSDataBase();
    DbProviderFactories.GetFactory("System.Data.SqlClient"));
    DbCommand command = dbDSS.GetStoredProcCommand("spMediaGetOASList");
    dbDSS.AddInParameter(command, "bWithAccount", System.Data.DbType.Int32, Convert.ToInt32(0));
    dbDSS.AddInParameter(command, "UserID", System.Data.DbType.Int32, Convert.ToInt32(1));
    dbDSS.LoadDataSet(command, dsOAS, dsOAS.OASConfigs.TableName);
    }

    protected Database CreateDSSDataBase()
    {
    return DatabaseFactory.CreateDatabase();
    }
    ----------------------------------------
    appConfig
    ------------
    <dataConfiguration defaultDatabase="MyService.Properties.Settings.DSSConnectionString" />
    <connectionStrings>
    <add name="MyService.Properties.Settings.DSSConnectionString"
    connectionString="Server=CMDLHRDSS01;database=DSS_Test;user id=test;password=test;"
    providerName="MyService.Data.SqlClient" />
    </connectionStrings>
    ------------------------------
    Thank you in anticipation.
     
    rao.kamran, Apr 14, 2009
    #1
    1. Advertising

  2. rao.kamran

    jbuyers

    Joined:
    Jun 22, 2009
    Messages:
    47
    hmmm..

    check your firewall or program manager to see if the whole damn thing isn't trying to rock a blocked port.

    wish I had more to say on this one.:stupido:
     
    jbuyers, Jun 22, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. E. Hand

    Creating and maintaining a digital image library

    E. Hand, Jan 3, 2004, in forum: Digital Photography
    Replies:
    9
    Views:
    665
    Anne P. Mitchell, Esq.
    Jan 6, 2004
  2. Juergen Kluth
    Replies:
    1
    Views:
    1,274
    Charlie Russel - MVP
    Feb 5, 2009
  3. pankaj garg

    Enterprise Library

    pankaj garg, Jul 29, 2009, in forum: General Computer Support
    Replies:
    0
    Views:
    1,117
    pankaj garg
    Jul 29, 2009
  4. scott93727@gmail.com

    DataBase DataBase DataBase DataBase

    scott93727@gmail.com, Sep 26, 2012, in forum: Computer Information
    Replies:
    0
    Views:
    1,190
    scott93727@gmail.com
    Sep 26, 2012
  5. scott93727@gmail.com

    Database Database Database Database

    scott93727@gmail.com, Sep 27, 2012, in forum: Computer Information
    Replies:
    0
    Views:
    1,035
    scott93727@gmail.com
    Sep 27, 2012
Loading...

Share This Page