data-access-layer

Data Access Layer for Analysis Services w/Dynamic MDX

We have project that uses Analysis Services as it's datasource. To try to avoid having to create 100's of queries because of all the selection options we allow, we create our mdx queries with alot of switches and string concatenation. This is our "Data Access Layer". It is a beast to manage and the smallest mistake: missing spaces, m...

N Layered MVC Project Question

Hello, I am getting a bit confused about how an N Layered MVC application should look. I am thinking as standard there should be: ASP .NET MVC Project Service Layer Data Access Layer (containing repositories) I am confused as to where the entity framework model should sit (.edmx). Should it be in the Data Access Layer? Should any par...

How to ensure certain properties are always populated when returning object from DAL?

I have a Question class which has a property OptionList, which is nothing but a List. Questions and Options are stored in diff tables in the db. Now there are times when I need just the Question object without its Relational Properties, that is properties which are entities mapping to a different table in the db. Thus in this case I do...

why FIFO is used in namedpipes of session layer ?

please help me . Thanks in advance ...

Guidelines for building Data Acces Layer with SQL

There are a lot of information on building DAL with ORM ((N)Hibernate, LINQ to SQL). But I can't find any recomendations on doing it with plain SQL or mixed (ORM + SQL) approach. I wonder, are there any resources (sites, books) on this subject? Besides common best practices I've got a few points of interest: how organize storing ...

EF4 DAL design and the ObjectContext: Argument with co-worker

Hello all. I work with a senior developer who is a guru .NET architect. We have had many constructive arguments over the last 6+ months and generally I concede defeat in most of our discussions. I have learned stacks from working with him. There is one design problem we are currently in disagreement with, however, and I would like some ...

Where should connection strings be stored in a n-tier asp.net application

Folks, I have an ASP.NET project which is pretty n-tier, by namespace, but I need to separate into three projects: Data Layer, Middle Tier and Front End. I am doing this because... A) It seems the right thing to do, and B) I am having all sorts of problems running unit tests for ASP.NET hosted assemblies. Anyway, my question is, w...

DDD vs N-Tier (3-Tier) Architecture

I have been practicing DDD for a while now with the 4 distinct layers: Domain, Presentation, Application, and Infrastructure. Recently, I introduced a friend of mine to the DDD concept and he thought it introduced an unnecessary layer of complexity (specifically targeting interfaces and IoC). Usually, its at this point, I explain the b...

Disposing of custom Data Access Layer references

Our application uses a custom DataAccessLayer class almost exclusively, and within that we do use Data Access Application Block (currently version 2). We are getting the infamous "GetOrdinal" error sporadically. We are not using out-of-method connections. We are using DAAB version 2. Below is a typical example of our DAL methods: Pu...

Designing layered app with NHibernate and context changing database

Hi eveybody, I'm designing a C# application Presentation ( web site + flex apps ) Business Logical Layer (might be WCF to enable multi client platforms) Data Access Layer ( With NHibernate ) We're going to integrate our solution in many preexistant client's database environnements and we would like to use NHibernate in the DAL.. My...

should I use a static DbUtil class for web, is it dangerous ?

is it ok to use something like this in the web: (my application is on asp.net mvc) public static class DbUtil { public static int Insert(object o, string cs) { using (var conn = new SqlConnection(cs)) using (var cmd = conn.CreateCommand()) { ... conn.Open...

Sharing a common DAL between WPF, Silverlight, and ASP.NET

What is the best method/technology to sharing the same data access layer between WPF, Silverlight, and ASP.NET? I am using ADO.NET Entity framework, and was thinking of a creating a DAL using the Repository pattern.Then using the RIA Services as a dummy middle man to connect Silverlight and ASP.NET. Is this a solid plan or are there ot...

Entity Framework vs Spring.NET

I'm trying to build an e-commerce site. Which technology should I use for the Data Access Layer? What are the pros and cons of each? I plan on using Silverlight for the Intro and Catalog. Thanks! ...

Data provider class for sql database

I need to write a data provider class to pull data from a sql database for use in a webpage that will display a bing map. Does anyone have a link they could provide with a tutorial on how to do this? I have very little experience using a db to provide dynamic data for a web page so any help is appreciated. The Database is a sql Azur...

Should my persistence class return Option or rely on exceptions?

My application's persistence layer is formed by a Storage trait and an implementing class. I'm vacillating on this issue: should the fetchFoo(key: Key) methods should return Option[Foo], or should they throw FooNotFound exceptions if the key cannot be found? To add flavour to the issue, the persistence layer - it is written in Scala - i...

Should I hide generated classes behind a layer?

I have several classes that were generated from a WSDL and I need to write 2 small applications that read some input data, call the webservice and write the responses. Right now I created a bunch of very simple wrapper classes that take the data from the objects returned by the webservice call. I created a wrapper around the webservice ...

Communication between BLL and DAL

Solution setup: DAL (class library) BLL (class library) Common (class library (some common functionality - enums, logging, exceptions,...)) Application1 (Windows Application) Application2 (Windows Application) WebApp (Web application) ... Let's say I have a Customer entity, which is: a table in SQL server a CustomerDataTable in DAL...

C# Data Layer and Dto's

I have recently joined a company that using typed datasets as their 'Dto'. I think they are really rubbish and want to change it to something a little more modern and user friendly. So, I am trying to update the code so that the data layer is more generic, i.e. using interfaces etc, the other guy does not know what a Dto is and we are ha...

A question regarding c# interfaces and maybe generics

Hi, We have built an internal tool that generates the whole data access, each table has a class the represents it's data and all the common operations.(think lightweight Entity framework). These DataAccess objects always have a constructor that receives a connection string, and a Load function that receives a SqlDataReader. Something ...

Returning strongly typed stored procedure results

Currently, if we want to get a list of records from the database, our DAL returns a DataTable to our business layer, which then returns the same DataTable to our calling interface (in this case an asp.vb page). However I don't believe we should be returning a DataTable from the BLL, I always thought it would be better to return a strong...