data-access

Saving multiple objects in a single call in rails

I have a method in rails that is doing something like this: a = Foo.new("bar") a.save b = Foo.new("baz") b.save ... x = Foo.new("123", :parent_id => a.id) x.save ... z = Foo.new("zxy", :parent_id => b.id) z.save The problem is this takes longer and longer the more entities I add. I suspect this is because it has to hit the database...

Recommend .NET data access layer/middle tier

Hi, I'm currently creating an MVC application that will likely to expand to include a silverlight, wpf and possible windows phone all using the same data. So I've created a class library to keep all my objects in and I've created the MVC app. My question is what would be the best way to access the data? Taking into account possible ex...

Database access through collections

Hi All, I have an 3 tiered application where I need to get database results and populated the UI. I have a MessagesCollection class that deals with messages. I load my user from the database. On the instantiation of a user (ie. new User()), a MessageCollection Messages = new MessageCollection(this) is performed. Message collection accep...

Best Data Access Model for WinForms applications

Which data-access model has the best performance and speed for a C# Winforms application? Dataset? NHibernate? Entity Framework? Why would people say not to use Datasets ? ...

Access modifiers - Property on business objects - getting and setting

Hi, I am using LINQ to SQL for the DataAccess layer. I have similar business objects to what is in the data access layer. I have got the dataprovider getting the message #23. On instantiation of the message, in the message constructor, it gets the MessageType and makes a new instance of MessageType class and fills in the MessageType in...

Overly accessible and incredibly resource hungry relationships between business objects. How can I fix this?

Firstly, This might seem like a long question. I don't think it is... The code is just an overview of what I'm currently doing. It doesn't feel right, so I am looking for constructive criticism and warnings for pitfalls and suggestions of what I can do. I have a database with business objects. I need to access properties of parent objec...

Visual Studio 2010 ADO.NET Data Model vs Linq to SQL

What's the difference between the two? They seem to have the same functionality at first glance. Which one has faster performance which one is easier to use? ...

Best way to get a single value from a DataTable?

I have a number of static classes that contain tables like this: using System; using System.Data; using System.Globalization; public static class TableFoo { private static readonly DataTable ItemTable; static TableFoo() { ItemTable = new DataTable("TableFoo") { Locale = CultureInfo.InvariantCulture }; ItemT...

A good(elegant) way to retrieve records with counts.

Context: ASP.NET MVC 2.0, C#, SQL Server 2007, IIS7 I have 'scheduledMeetings' table in the database. There is a one-to-many relationship: scheduledMeeting -> meetingRegistration So that you could have 10 people registered for a meeting. meetingRegistration has fields Name, and Gender (for example). I have a "calendar view" on my sit...

how to solve these in c#

Possible Duplicate: How to show a error message if the data is already inserted in the database in c# protected void Button2_Click(object sender, EventArgs e) { try { SqlConnection conn = new SqlConnection("Data Source=KING;Initial Catalog=semasinter;Integrated Security=True"); SqlCommand command = new ...

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

Help with asp.net mvc data access methods

In my app i am now facing several issues of where to perform some calculations. I am using Repository Pattern... (at least trying to) Here's how it works.. each Employee has many Physical_Exams.. and for each employee I need to be able to get his Initial Body_Mass_Index and his Last Body_Max_Index... of course each exam has a Date attrib...

What is the Java equivalent of .NET's Enterprise Library?

I am a .NET guy but recently have been placed on a Java project. Is there a java equivalent of .NET's Enterprise Library? More specifically, I only need a configuration manager, data access helper (parametrization and sanitize), and maybe a logger. What are the hot tools for java development? ...

DAL/BLL and Client/Server: Should the client use BLL or DAL objects for presentation? Or maybe another layer (data transfer object?).

Hi, I'm writing a client/server system. The server has a DAL/BLL design. The client is responsible for presenting the data objects and providing dialogs and wizard to allow the user to update these objects (i.e. adding/editing a user). Initially I thought I'll just make the DAL objects have a universal data provider object so they can...

Best data access methods for PHP/Codeigniter/jQuery/MySQL

I'm originally a .NET dev by heart so I've always been use to having ADO.net and LINQ for strongly typed, easy data access into gridviews and other .net controls. In trying to learn PHP and MySQL with CodeIgniter and a dash of jQuery, but I'm having a hard time visualizing my data access methods. I want to use a PHP or jquery grid for ...

Need help locking my code for SQL Server

We want to build into our software the capability to build SQL queries freehand (currently cannot do so with our software), but need to be able to lock it down so that users cannot make any changes, only select data from certain tables. Are there any good guides for helping me to lock this down appropriately (ie, least permissions neede...

Mapping Application Blocks in Enterprise Library 5.0 (Data Access Application Block)?

I have been dabbling at Enterprise Library 5 Data Access blocks and it is pretty neat that you can return objects using IRowMapper (with and without creating accessors) http://msdn.microsoft.com/en-us/library/ff664533%28v=PandP.50%29.aspx I have been trying to do the reverse. Save objects to DB using some sort of Mapper, but could not ...

.NET ODBC Oracle Params getting param name returned by db provider- possible?

I'm converting some RDO code to ODBC Provider code in .NET. The problem is parameter names were not specified in the orignal code, but param values were retrieved by parameter name after the command was executed. Is there anyway to have parameter names populated by the provider once the command is executed so calling code can access pa...