Enterprise Library Data access application block 2.0
-
Hi guys, Please help,I am having an issue with data access block connection to the database from my class library project. using the data access block to connect to database works fine in my website project. but i try creating a separate class library project to connect to the database i now receive an error message. "The value can not be null or an empty string." and this is the code:
Database motomandb = DatabaseFactory.CreateDatabase(); DbCommand motomandbCommand = motomandb.GetSqlStringCommand(query); using(DbConnection motomanConnection = motomandb.CreateConnection()) { DbTransaction motomanTransaction = motomanConnection.BeginTransaction(); try { rowsaffected = motomandb.ExecuteNonQuery(motomandbCommand, motomanTransaction); motomanTransaction.Commit(); } catch (Exception e) { motomanTransaction.Rollback(); } }
thanks in advance