data-access-layer

WPF - Where to put DAL in 3-tier architecture design with MVVM?

I'm fairly new to the whole n-tier architecture thing, and I had some questions about using MVVM with a 3-tier application. From my understanding, we have: The View, or UI layer, which is the xaml file The Model, which is a custom class containing properties and methods that "models" the data object The ViewModel, which is the "adapte...

cannot use a dll that has subsonic dataaccess

i generated my dataaccess dll using subsonic 3.0. i have a new proj referenced to this dll and am tryign to insert data to my mysql database. i get the following configuration error. however when i look at my App.config, i have a connectionstring that defines my database connection. <?xml version="1.0" encoding="utf-8" ?> <configurati...

DAL + BLL + LINQ + Enterprise Library 5 + .net 3.5

What are the Best practices for coding Data Access Layer and Business Logic Layer with combination of LINQ and Enterprise Library 5.0 in .net 3.5? ...

Encapsulate a data access layer with WCF or WCF Data Services

Are there scenarios where it makes sense to encapsulate a data access layer (of a ASP.NET webapplication) with WCF or WCF Data Services ? Makes it sense to use a Service inside the application ? ...

Is PHP serialization a good choice for storing data of a small website modified by a single person

Hi, I'm planning a PHP website architecture. It will be a small website with few visitors and small set of data. The data is modified exclusively by a single user (administrator). To make things easier, I don't want to bother with a real database or XML data. I think about storing all data through PHP serialization into several files. ...

C# Lightweight Data Access From Windows Forms App

I have a simple C# Application that requires access to an admin table which persists two variables. Can someone tell me what is the fastest(in terms of dev time) method to interact with the database to retrieve and update the table. I don't wish to create an entire data layer just to gain access to a single table? ...

Trying to determine if NHibernate or anything else would apply for accessing a web service

Here's the situation. We have a 3rd party middleware (using SQLServer as a back-end) which we communicate with using an HTTP service link and XMLRPC-like messaging. The service always returns a dataset as results of any commands that returns something. There is a way to pass an embedded SQL statement to the service. So, we do not have...

Business objects built up directly from a database query

...What is it called? More elaborate: For my application I created a nice business model to work with as in-memory objects. It's storage and view agnostic. Now, for the storage layer, there's a database: I'll construct SQL queries (the fewer the better) that selects/joins etc. all data I need from the relevant tables. A kind of "middle ...

Reusing SqlConnection within a DAL method

Suppose we have a DAL method public void BuyProduct(int productId, int quantity, int buyerId); Within that method we need to call 2 stored procedures: EXEC tblOrders_CreateNewOrder EXEC tblProducts_RecalculateStock Is it a good practice to create 2 SqlCommands - one per stored procedure and to use a single SqlConnection to execute...

Why are Data Access Layer built with Service AND DataProvider ?

Hallo, Why do I need 2 classes to get my data? Why is a DataProvider class not enough, if the Service does actually nothing except call the method in the DataProvider ? interface ICustomerDataProvider inferface ICustomerService class CustomerDataProvider : ICustomerDataProvider { // Do Sql queries here // return sql data and w...

Are there existing data layers I can use for an application I'm building?

I'm writing a .NET application and the thought of implementing a data layer from scratch is icky to me. (By data layer I'm referring to the code that talks to the database, not the layer which abstracts the database access into domain objects [sometimes called the data access layer and used interchangeably with data layer].) I'd like ...

Design Strategy: Query and Update data across 2 different databases

Hi We have a requirement in which we need to query data across 2 different databases ( 1 in SQL Server and other in Oracle). Here are the scenarios which need to be implemented: Query: Get the data from one database and match for values in other Update: Get the data from one database and update the objects in other Technology that...

I'm having problems understanding IQueryable<>

So I'm trying to understand IQueryable<>. A tutorial I'm reading suggests using it but not really sure why. The code simply returns some values using LINQ to SQL. I've done this plenty of times in the past, but not using IQueriable<> Why use it with my functions that return more than 1 value? Here's my code: public IQueryable<Items...

What design pattern works for you? ASP.NET with MySQL.

Hi this is a question to all experienced developers who create their web applications using ASP.NET(C#) with MySQL. I am currently using the Microsoft Enterprise Library to implement a database factory design pattern. I have a DAL which returns a DataTable. I have a BLL that executes that DAL which returns a List<> of my DataObjects. T...

Generating LINQ to DB2?

I have an existing DB2 database at my job. (At least, I think it's DB2. They refer to it as "the iSeries" and it looks and feels like DB2 on some mainframe-ish hardware.) For years the .NET developers in my department have just manually written ADO commands and queries to get specific data from specific tables, etc. At the moment I'm...

Not quite a Singleton

I'm using ActionScript3 to develop a Data Access Layer for an application another developer is working on in my team. One of the objects, lets call it User is expensive to construct. Each user has a unique ID number so I can tell if they've been created before or not, and all User objects are stored in an array somewhere else. I want to...

How to Load a Generic class without loop

ok this is the thing I have right now which is working quite well except its a bit slow: Public Function GetList() As List(Of SalesOrder) Try Dim list As New List(Of SalesOrder) Dim ds As DataSet ds = cls.GetSalesOrderList 'CLS is the data access class For i = 0 To ds.Tables(0).Rows.Count - 1 Dim row As Data...

How to return multi-table join value from BLL

Hi All, This question is regarding the ASP.NET webservice that i am creating using the DAL-BLL architecture for my final school project. I have a stored procedure, which is a select query with an inner join for 2 tables. Hence the stored procedure returns multi-table value. One of my DAL tableAdapter methods accesses this stored procedu...

Should I Unit Test Data Access Layer? Is this a good practice and how to do it?

If I'm having Data Access Layer (nHibernate) for example a class called UserProvider and a Business Logic class UserBl, should I both test their methods SaveUser or GetUserById, or any other public method in DA layer which is called from BL layer. Is this a redundancy or a common practice to do? Is it common to unit test DA layer, or th...

DAL: repository boundaries question

There is DAL library that exposes dozen of repositories. One repository per entity. There is PersonRepository & PhotoRepository. When I add a new method to repository and method deals with entity it's obvious where I have to put it. If I want CreatePerson I'll create PersonRepository::Create(...) or when I need to update photo I'll cre...