data-access-layer

How to design a provider independet DAL (.Net)

I am currently developing a query builder application, basically a simple graphical interface that should allow users with no knowledge of SQL to define various queries on a database (joins, select, update, insert, delete). I will be using .Net 3.5. My application should support multiple databases, it should work with MS-SQL Server, MySQ...

yet another Data Access Layer ( c# .net 2.0)

Realised I am writing yet another code generator to do the sps/classes/interfaces etc for a simple ORM layer. This time most of the guts are in SQL. I have a general-purpose C# DAL for calling sps/getting results etc. (took me all of an hour or so and is tiny). I thought for sure there'd be an easier way by now... is there? I am confid...

Need advice on selecting a data access method

I am in the early stages of planning a conversion of a large classic ASP database application to ASP.Net and I'm having trouble picking out which data access method to use. I have played around with Linq To SQL, Dynamic Data, strongly typed datasets, Enterprise Library (Data Access Application Blocks), and a tiny bit with Entity Framewo...

.NET MVC or just plain old ASP.NET?

This is a shoutout as I've been spending the last few days learning about .NET and the process has left me a little confused rather than enlightened. Just as a background info, I have knowledge of PHP (have even used CakePHP to create a whole app rather easily) and Rails. I am wondering if I should pursue ASP.NET or should stick to l...

Active Record Pattern and WCF: How to ensure data access methods on clients are "missing"?

I'm new to the Active Record design pattern and usually use a Data Mapper type pattern. The project I'm currently working on seems to meet nicely with the requirements for using the Active Record pattern in that the domain is fairly small and the object and database schemas are quite similar (though not identical obviously). I plan on ...

Do you allow the Web Tier to access the DAL directly?

I'm interested in perceived "best practice", tempered with a little dose of reality here. In a web application, do you allow your web tier to directly access the DAL, or should it go through a BLL first? I'm talking specifically of scenarios where there's no "business logic" really involved -- such as a simple query : "Fetch all custom...

Presentation, Business and Data Layer

I just started programming in C# and was reading about dividing your application / website into the three different layers was the best practice but I am having a hard time understanding exactly how. Im working on a pet project to lean more about C# but I dont want to start on any bad habits. Can you look at what I have and see if I am d...

Method-level documentation in n-Tier applications

My Situation: The data request chain of my application looks like this: (Client) -> (WebService) -> (SQL or OLAP Cube) The client is a Silverlight Application that uses a generated proxy to communicate with a WCF webservice. Which in turn does authorization and accesses SQL DB's and OLAP Cubes using a DAL component, basically it just...

What section should I place my SqlDataReader code in?

Hi, I am fairly new to c# and am trying to write a n-tiered web application. To make sure that I put the logic and code in the right place I just have a question about where to put my code. I have three main section: DataAccess code - inside a folder named "BusinessLogic" inside my App_Code folder. Business Logic code - inside a fold...

Separate Read/Write Connection for SubSonic

The security policy at our client's production environment requires that we use separate connection to execute writes and read to and from database. We have decided to use SubSonic to generate our DAL. So I am interested in knowing if it is possible and if yes how? ...

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 ...

JPA why use createNamedQuery

I'm in the processes of changing my DAO layer from using Hibernate API to using a pure JPA API implementation. It looks like the recommended method is to use the createNamedQuery from the entity manager. The named queries are stored in annotations in the model/entity classes. This just not makes sense to me. Why would you define the ...

Using MySql stored procedures for .NET Data Access Layer

Hi. I'm using .NET 2.0 and/or 3.5. Weird thing is, everytime I add a query, whether via TableAdapter or a plain query in a Dataset, using a MySQL stored procedure (whether be a select, update, insert, delete), the wizard doesn't finish (the dialog suddenly disappears, I'm back to designer mode and the query isn't added to the tableadap...

Refactoring DAL Code to Support Stored Procedures (C#)

private static readonly string dataProvider = ConfigurationManager.AppSettings.Get("Provider"); private static readonly DbProviderFactory factory = DbProviderFactories.GetFactory(dataProvider); private static readonly string connectionString = ConfigurationManager.ConnectionStrings[dataProvider].ConnectionString; /// <sum...

Entity Framework - layered design - Where to put connectionstring?

Hi, I am using a layered architecture with the Entity Framework as my datalayer with a bunch of repositories on top which contain the Linq-To-Entities queries. The data layer is one project, next to that I have a Services layer and the interface, which is a website. I want my website to be responsible of specifying the connectionstring...

Using SubSonic Query to on multiple tables

I want to select rows from multiple tables using subsonic. For one table I can use Query object, but I don't know how I can add more than one tables to query. ...

Column does not exists in datasouruce problem when binding SubSonic collection to dropdown.

I've a table with Primary Key with _ (underscore) in its name like: User_Id. When SubSonic generates DAL it removes underscores. Now I'm binding the object collection to DropDownList like follows: private void LoadCbo() { UserCollection users=(new UserCollection()).Load(); User u=new User(){ UserId=-1, Name="[Sel...

Is there deep loading in subsonic?

Hi, I am new in subsonic, and can't find the way to load data whith it's parents or childs data in one query. Is it possible in subsonic? ...

SubCommander and VS2008 - DAL not found

I have VS2005 and VS2008 Side by side (I just installed VS2008). When I run SubCommander in VS2005, everything works perfectly. However, when I run it in VS2008, my generated classes are not found in the IDE. Is there a configuration change, or something I'm missing? Thanks, ...

POCO's, DTO's, DLL's and Anaemic Domain Models...

I was looking at the differences between POCO and DTO (It appears that POCO's are dto's with behaviour (methods?))and came across this article by Martin Fowler on the anaemic domain model. Through lack of understanding, I think I have created one of these anaemic domain models. In one of my applications I have my business domain entit...