data-access-layer

Guidance needed ASP.Net app connection string

Net 2.0 / Visual Studio 2005 / ASP.Net web app I read many posts and comments on this site but either some are too confusing to follow for me or others don't meet my requirement. So I have a 3 tier application - UI, BLL, DAL. In my DAL, I created DataSets by draggin storedprocedures from the Server Explorer. So the connection string g...

Manual DAL & BLL vs. ORM

Which approach is better: 1) to use a third-party ORM system or 2) manually write DAL and BLL code to work with the database? 1) In one of our projects, we decided using the DevExpress XPO ORM system, and we ran across lots of slight problems that wasted a lot of our time. Amd still from time to time we encounter problems and exceptions...

Settings.Designer file and Staticness

I have a DAL class library that is included in my program as a DLL. The below line is from the DAL to initialize the connection. DataSet ds = new DataSet("table"); SqlConnection cnn = new SqlConnection(Settings.CMOSQLConn); When I run this I get the below error: An unhandled exception of type 'System.StackOverflowException' o...

ASP.NET and Entity Framework in Layered Architecture - using Entity Framework for ORM only

I have an ASP.NET application that uses a layered architecture e.g. presentation layer, business logic layer, data access layer. I don't want to the business layer to have to know anything about how the data access layer is implemented and I'm not looking to bind the Entity's directly to a data control using the EntityDataSource or anyt...

SubSonic - AllStruct.cs looks wrong

Using SubSonic 2.2, after DAL generation with sonic.exe, the AllStruct.cs content looks wrong: // <auto-generated /> namespace ...DAL { #region Tables Struct public partial struct Tables { ... } #endregion #region Schemas public partial class Schemas { ... } #endregion #region View Struct public partia...

Switching data access strategy far into a project?

In a project we have implemented the data access layer (DAL) with a visual designer that auto-generates a lot of code (in our case: strong-typed DataSets and DataSetTableAdapters in .NET). However, using source control I find it troublesome to edit and add new things to the DAL. We have started coding new data access by manually writi...

Dataset returning ZERO results

I am trying to fill in a combobox on my winform app from the database. I know there is info in the DB. I know the SP works. It returns the correct ColumnNames. But the DataSet itself is empty? Help!?!? Call from my form--> cboDiagnosisDescription.Properties.DataSource = myDiagnosis.RetrieveDiagnosisCodes(); The RetrieveDiagnosis...

What patterns to use to build layers for delphi win 32 application

I want to develop mysql database application using dbexpress to develop from scratch or work with existing databases. To create reusable layers what patterns-components should I use. I want the app to be scalable to n-tier easily. Tried google search for ready frameworks but I found nothing much informative (some lack documentation, some...

Advice on passing criteria information to service call.

I have a repository that has several specifications available. For Ex. I can call: EmployeeRepository.EmployeeSpecification().ForRegion("West Coast").Executives().OrderByLastName().OrderByFirstName().Page(1, 10). This will return me a result package containing the results array and metadata created by the specifications such as how many ...

How to manage SqlDataReaders in a data access layer?

I am trying to get a better handle on decoupling my code, code reuse, etc. I'm tired of typing the below every time I want to read some rows: using(SqlConnection conn = new SqlConnection(myConnString)) { using(SqlCommand cmd = new SqlCommand(cmdTxt, conn)) { conn.Open(); using(SqlDataReader rdr = cmd.ExecuteReader()) {...

Manually written business objects or using DAL objects?

Suppose you have three tiers (with namespaces): User interface (App.UI) - calls business layer processes and communicates using objects Business layer (App.Core) - orchestrates processes and uses DAL layer using objects DAL (App.Data) - directly manipulates store and persists objects Let's say that you have User table and thus reflec...

How should I access another module's DAL?

OK, so I have a couple of modules in my application. One is called ProductCatalogue and another is called Contracts. We now have a need for a contract to be associated with a number of products (eg the products which a party to a contract is allowed to order). Within the ProductCatalogue module we have a ProductDAL class which has the fo...

How to update only one row in a DataGridView?

I have a DataGridView that's populated from a DataTableAdatper, as in this tutorial. I guess since it's an ODBC MySQL connection, it's not generating DBDirectMethods for me. My question is how do I update a specific row in the DB after the user has edited it in the grid? Do I need to specify a DeleteCommand in my adapter? When would it...

Linq To SQL DAL and lookup data source

I am learning linq to sql and I am trying to setup a lookup combo box in my web page. I was using a linq data source but I then moved my linqtosql code to it's own class library for my DAL dll (took out of app_code folder). So, I am converting the page code to be able to still have lookups driven now by a biz object. Here's what I hav...

What is the best approach to make DAL?

I want to make a perfect custom DAL (data abstraction layer) class to use with all my projects. I've searched the internet and found some samples for this but I never know which is the best approach. Is it to make [Attributes]? Or use <Generics> or something else? So please just give me a head line and I'll go on from there. Thanks a...

Cross platform datastore for storing application data?

Our application currently stores bunch of configuraton & application specific data to files on disk. Configuration data is stored in a single .ini file where as application data is distributed across multiple files. The application has grown now and data manipulation using files is becoming a nightmare. We would like to make a switch to ...

Can I use the the power of Generics to solve my issue

I have a wierd issue. I am loading 1k invoice objects, header first then details in my DAL. I am using VB.NET on this project. I am able to get the invoice headers just fine. When I get to loading the details for each invoice I am getting a timeout on SQL Server. I increased the timeout to 5 minutes but still the same thing. If I reduce ...

Mapping class properties to generic columns in table .NET

I have have a SQL Server table which has generic names like Text1, Text2.. etc. The table was designed like this because the same structure is used for different projects. I have a class in .NET which has properties. Say a Customer class has a property called FirstName. How can I do the mapping from FirstName to Text1 just once (centra...

Pagination and DAL

I'm currently implementing my DAL using DAO's. I would like to do pagination at the database level, so in my DAO's I currently have methods like getEvents($page, $limit) and getEventCount() Then in my service layer I'm returning an array array($events, $eventCount) and setting up the pagination in my controller (using Zend_P...

What's your favorite Advanced ASP.NET book?

What would be some highly recommended books to get for a mid-level developer to learn advanced ASP.NET/C#/VB.NET techniques? Including, but not limited to, taking advantage of inheritance, when to use base pages, overriding base class methods, application architecture, interfaces, applying GOF design patterns in Web Applications, DAL, an...