data-access

SubSonic 3.0 ActiveRecord - Preferred approach building object graph?

Say I have a forum system with Threads, Posts and Tags. The structure is the same as StackOverflow: Threads have a 1-many relationship to Posts, and Tags have a many-many relationship to Threads. The (simplified) tables: Thread ------ ThreadID int PK Title varchar(200) Tag ---- TagID int PK Name varchar(50) ThreadTag ----------- T...

How to SELECT data from SQL Server using .Net 2.0 -- as simple as possible.

Easy question: I have an app that needs to make a half dozen SELECT requests to SQL Server 2005 and write the results to a flat file. That's it. If I could use .Net 3.5, I'd create a LINQ-To-SQL model, write the LINQ expressions and be done in an hour. What is the next best approach given that I can't use .Net 3.0 or 3.5? Are ADO.NE...

How Repository, IdentityMap, UnitOfWork, DataMapper, QueryObject and VirtualProxy work together?

I know how all those patterns work separately, I have read some Martin Fowler articles and books. The problem is that I can find only separate different implementations of each of these patterns but I still haven't found some reference architecture diagram (UML or other) which I could use as a starting point to develop a prototype for an...

Data Access object: Singleton or many small ones?

When developing an application (web, win, whatever) which does alot of data access, is it better to keep your data access object open for the length of the request (i.e. do many things in a row, then close it when you finish), or keep opening and closing new ones? protected aDataContext dc = new aDataContext(); vs private aObject Get...

"Expected:=" compile error in vb6 while adding recordset to SQL Server 2005 database

Here I created recordset in vb6 and store values in that vb6. i want to write that recordset values to database table. while executing that code i am getting compile error like "Expected:=". please see the code below. Please let me know where I am doing wrong. I am getting error in cmdCommand.Execute() With rcdDNE.Fields .Appen...

Linq to DataTable without enumerating fields

Hi, i´m trying to query a DataTable object without specifying the fields, like this : var linqdata = from ItemA in ItemData.AsEnumerable() select ItemA but the returning type is System.Data.EnumerableRowCollection<System.Data.DataRow> and I need the following returning type System.Data.EnumerableRowCollection<<object,object>> (...

Best practice for data access from text file in iPhone app?

OK. I have an application which is using data that is stored in text files. The data is such that the application's users will drill down through a couple of levels of nested table views to get to the data that they need to access and alter, at which point any changes will be written back to the text files. As the drilling down through...

What exactly is "persistence ignorance"?

Persistence ignorance is typically defined as the ability to persist & retrieve standard .NET objects (or POCOs if you really insist on giving them a name). And a seemingly well accepted definition of a standard .NET object is: "...ordinary classes where you focus on the business problem at hand without adding stuff for infrastructur...

Linq2Sql Updates

Wondering if anyone else has done most of their Update SQL using stored procedures over Linq2Sql? I like Linq2Sql for all the other operations but Updates seem to be nasty. The generated SQL doesn't look good in profiler with all the columns in the Where clause, then you have to select the current object to set the fields from the edited...

How to handle authenticated user access to resources in document oriented system?

I'm developing a document oriented application and need to manage user access to the documents. I have a module that handles user authentication, and another module that handles document CRUD operations on the data store. Once a user is authenticated I need to enforce what operations the user can and cannot perform to documents based upo...

What is a good approach for a Data Access Layer?

Our software is a customized Human Resource Management System (HRMS) using ASP.NET with Oracle as the database and now we are actually moving to make it a product that supports multiple tenants with their own databases. Our options: Use NHibernate to support Multiple databases and use of OO. But we concern related to NHibernate learni...

Entity Framework on a database without foreign keys

Hi, I'm currently working with a large database (approx. 500 tables) all without any foreign keys define. My question is there an easy way to set up the relationships within entity framework (version 1 or 2) without doing it all manually? Also some of the tables have a complex relationship type. For example a customer has a parentID ...

Visual Basic 6 tutorials for data access and CRUD

Do you know some tutorials (preferably a website or a blog) in Visual Basic 6 (not Visual Basic .NET) for data access or CRUD? The caliber and depth that I'm looking for is similar to this site: Data Access Tutorials for ASP.NET http://www.asp.net/learn/data-access/ Although the above site is for web applications, I am looking for a ...

Fluent Nhibernate, Composite Keys and could not resolve property: error message

Hi, I've got a simple object with three properties. This links to a table with three columns, with two of the columns being primary keys (one int the other a datetime). Whenever I try and query nhibernate I get the following error message: could not resolve property: invdate of:Models.Invoice Have I missed something simple in se...

Execute multiple SQL commands in one round trip

I am building an application and I want to batch multiple queries into a single round-trip to the database. For example, lets say a single page needs to display a list of users, a list of groups and a list of permissions. So I have stored procs (or just simple sql commands like "select * from Users"), and I want to execute three of the...

WCF SOA: CRUD Data Access Service...why bother (or is our design wrong)?

Hello all again. We have a Data Access service in our SOA WCF system. This service is responsible for doing CRUD (create, update, delete) operations on "system wide" database tables, and is also the source of this data for queries. Any other service in the system wanting to access the tables under the contol of the DAS have to go to the...

How do I create a generic overall .NET programming structure for my company?

I'm in a company that writes their own business data applications when there's no good off the shelf alternative. Most often it's - a login screen - some screens that are mostly visualizations of SQL Server tables - some reports In the past they've used MS Access. These are not exactly the most elite coders but they mostly get how ...

Please explain "How Fanboys See .NET Data Access Strategies"

This chart has been linked a number of times on blogs that I follow and I feel like a rube not getting it. So, going out on a limb here and asking this community. Please explain this grid from the blog post here. ...

Good practice to create extension methods that apply to System.Object?

Hello, I'm wondering whether I should create extension methods that apply on the object level or whether they should be located at a lower point in the class hierarchy. What I mean is something along the lines of: public static string SafeToString(this Object o) { if (o == null || o is System.DBNull) return ""; else { ...

How important is it for me to pool my connections?

It has been suggested to me that I rearrange my code to "pool" my ADO connections. On each web page I would open one connection and keep using the same open connection. But someone else told me that was important 10 years ago but is not so important now. If I make, let's say, 5 db calls on a web posting, is it problematic to be using ...