Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > General Computer Discussion > General Computer Support > Problem in Creating Database Through Enterprise Library 2.0

Reply
Thread Tools

Problem in Creating Database Through Enterprise Library 2.0

 
 
rao.kamran rao.kamran is offline
Junior Member
Join Date: May 2007
Posts: 3
 
      04-14-2009
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.SqlCli ent"));
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.DSS ConnectionString" />
<connectionStrings>
<add name="MyService.Properties.Settings.DSSConnectionS tring"
connectionString="Server=CMDLHRDSS01;database=DSS_ Test;user id=test;password=test;"
providerName="MyService.Data.SqlClient" />
</connectionStrings>
------------------------------
Thank you in anticipation.
 
Reply With Quote
 
 
 
 
jbuyers jbuyers is offline
Member
Join Date: Jun 2009
Posts: 47
 
      06-22-2009
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Database Database Database scott93727@gmail.com Computer Information 0 09-27-2012 02:43 AM
DataBase DataBase DataBase DataBase scott93727@gmail.com Computer Information 0 09-26-2012 09:40 AM
Enterprise Library - Class Library Greif. =?Utf-8?B?QUo=?= ASP .Net 7 12-06-2007 09:33 AM
enterprise application versus enterprise system jrefactors@hotmail.com Java 3 01-20-2005 01:32 PM
enterprise application vs. enterprise system jrefactors@hotmail.com Java 3 01-15-2005 07:12 AM



Advertisments