daab

DAAB, the best approach to use Database instances is ...

Guys, I am going to use Enterprise Library (4.1) and especially DAAB. Here is I have questions: What is the best approach and why: Every time when I need to run a DbCommand I create Database instance using DatabaseFactory.CreateDatabase(); I have a base class with instanced Database (using the same CreateDatabase() static method) and...

Hybrid NHibernate DAL/BLL

Hi, I have an existing asp.net webforms project that uses Microsoft's Enterprise DAAB for the DAL, I need to implement some extensive features, and I would like to use NHibernate to make things easier. Is there any design patterns/architectures out there that allow a hybrid DAAB/NHibernate DAL ? is it a good idea ? My thinking is: if ...

random SemaphoreFullException error in SQLHelper class within a WCF service

I have an IIS hosted WCF Service which uses SqlHelper class from DAAB version 2.0 in the data layer Once in a while, it throws exception at this line of ExecuteReader (a static method): Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader() Type: System.Runtime.InteropServices.COMException Message: The handle is invalid. (Excepti...

DAL desing using DAAB 3.5/4.0

I'm working on a .Net 3.5 web application.It has various modules say for example Customers,Orders,etc.... I need to a design Data Access Layer (DAL) for the same using Enterprise Library 4.0 (using Data Access Application block or DAAB) to connect to SQL Server 2005. Here is how i plan to go about it: • Have an interface called "IData...

How to Convert Datareader Result of DbType.Time to Timespan Object ?

I am reading a result from a MS SQL 2008 Database with a column type of dbtype.time from a datareader, using c# with DAAB 4.0 framework. My problem is the MSDN docs say dbtype.time should map to a timespan but the only close constructor for timespan I see accepts a long, and the result returned from the datareader cannot be cast to a lo...

How to update and insert with Data Access Application Block and OLEDB

Hello, I can't seem to find any good documentation on this. I want to use the Data Access Application Block with some dbf files and an access database. How do you use the AddInParameter method properly? If you have to use the "?" what is entered into the name parameter of that method? Someone else said that you can use the named paramet...

Handling a dynamic Connection String with DAAB

I'm in the process of adding a Data Access Layer for our ASP.Net 2.0 web application that was written almost exclusively using in-line SQL calls and copious use of copy/paste. Due to business concerns I am only able to re-factor small portions of the application at a time (can't settle in and do a huge re-design), so I have to live with ...

Microsoft Enterprise DAAB and Closing Connections

I noticed one of our internal apps was using DAAB, and that it appears to have some sort of connection leak. I thought I remember reading somewhere that when you used the following code: Database db = DatabaseFactory.CreateDatabase("ConnectionString"); IDataReader rdr = db.ExecuteReader("sproc") That the connection was closed for you,...

Run-time Error on deployed project using DAAB 4.1

I'm having a weird problem on deployment while trying to use Microsoft Enterprise Library's Data Access Application Block 4.1. I get the following Unhandled Exception when trying to use the element of the web application that utilizes the DAAB: Exception information: Exception type: BuildFailedException Exception message: The current ...

.NET TransactionScope on Oracle

Hello, we are using DAAB and TransactionScope on Oracle. Our application manage all the connection to only 1 database. This type of implementation it seems to need "Oramts.dll". Is there a way of using your DAAB and TrasnsactionScope without MTS? Thanks! ...

Returning multiple ref cursors from Oracle Procedure using DAAB & C#

I want to return data from an Oracle procedure to populate some Label controls. The procedure accepts 26 input parameters (search variable) and returns 3 output cursors. I have been successful returning data from a procedure which returns a single ref cursor using OracleCommand, a DataAdapter, and a DataSet, but have been having all kin...

Data Access Application Block (DAAB) and the SQL IN keyword (multiple criteria)

Hello, I am using the Patterns and Practices Data Access Application Block and I want to be able to perform a SELECT using multiple criteria like you can do in SQL using the IN keyword. Such as: SELECT * FROM SomeTable WHERE PrimaryKey IN (@keys) How can I pass in the @keys values? I do not want to have to dynamically build my SQL. ...

How to clear the parameter cache of a sql command?

I'm using Enterprise Library's DAAB. I have code like this: Database dBase = DatabaseFactory.CreateDatabase(); DbCommand dCommand = dBase.GetStoredProcCommand(StoredProcedureName, Parameters); dCommand.CommandTimeout = CommandTimeout; return dBase.ExecuteDataSet(dCommand); How can I clear the paramete...

Returning ref cursor from oracle stored procedure by using DAAB from MS EntLib 4.1

Is it possible to get ref cursor from oracle stored procedure by using DAAB from Microsoft Enterprise Library 4.1? ...

How does MS Data Access Application Block(daab) compare to ado.net datareader performance wise

I am going to use the DAAB to prevent a lot of manual labor in my database intensive application. But before I get started I would like to know if there would be any noticeable perfoemce differences between using the native ado.net datareader and the DAAB. ...

C#: Is this the correct way to use the SqlDataReader for DAAB

Hello, I have just started using the Data Access Application Block from microsoft. There are very few instructions on the correct way to use the library. Just wanted to know if this is the correct way to use the data reader. SqlDataReader reader = SqlHelper.ExecuteReader(config.ConnectionString, CommandType.Text, "select * from category...

Get Autonumber from newly inserted record in Access 2007 using Enterprise Library 4.1

It's been ages since I last used Access as a back end but I'm being forced to. I'm using Enterprise Library 4.1, the Data Access Application Block.. with .NET 3.5 and I wanted to know the best way (code sample if possible) to write an insert query that will automatically give me the newly inserted auto-number back..or if it's not possibl...

Using Enterprise Library DAAB in C# Console Project

How can I prepare the configuration settings (App.config, maybe?) I need to use Enterprise Library Data Access Application Block in a C# console project? Following is what I currently trying with an App.config in the console project. When I call DatabaseFactory.CreateDatabase(), it throws an exception which says: "Configuration system ...

Using DAAB to update a DataTable without a DataSet

Currently, there is only UpdateDataSet function that takes a dataset param. If there is only a datatable to update, with no dataset associated, do I need to create a dataset just to pass it in? Any way to update just a table? ...

Is a base class with shared fields and functions good design

I've got a BaseDataClass with shared fields and functions Protected Shared dbase as SqlDatabase Protected Shared dbCommand as DBCommand ... //also have a sync object used by the derived classes for Synclock'ing Protected Shared ReadOnly syncObj As Object = New Object() Protected Shared Sub Init() //initializes...