database

Data Access Layer design patterns

Hello, I have to design a Data Access Layer with .NET that probably will use more than one database management system (Mysql and Sql Server) with the same relational design. Basically, it has to be simple to switch from one database to another so I would like you to recommend me some web-sites or books that has been useful for you, with...

SQLite Parameter Issue with Guids

I am having issues with getting Guids to match in SQLite (0.4.8) when using parameters, when I use something like userGuid = 'guid here' it works, but userGuid = @GuidHere it does not. Anyone have any ideas? Create: CREATE TABLE Users ( UserGuid TEXT PRIMARY KEY NOT NULL, FirstName TEXT, LastName TEXT ) Sample Data: INSE...

Application Buddy Lists and Authentication - How does it all go together

This is a broad but specific question. The idea is that we want to tie in a 'buddy' functionality to a communications app. Very broadly, I believe that the application clients would connect to a central database/auth service which would provide the buddy data and then allow client apps to connect directly to eachother, without passing ...

PostgreSQL: Why can I connect to a user with a set password without having to give the password?

After creating a new user john with: CREATE USER john PASSWORD 'test'; CREATE DATABASE johndb OWNER john; I can connect to the PostgreSQL server with: psql -U john johndb The problem is that psql never asks me for the password. I realy need to know what's wrong, because of obvious reasons. ...

Right way to create custom pgsql types in django

What is the right way to create custom pgsql types for django application so that each time database is created with syncdb, all custom types are created prior to creating any tables (so that tables can use this type)? I also use django-evolution, but that's not an appropriate solution — it runs after syncdb. I can imagine doing a worka...

How to model this[Networks, details in post] in database for efficiency and ease of use?

At linkedin, when you visit someones profile you can see how you are connected to them. I believe that linkedin shows upto 3rd level connections if not more, something like shabda -> Foo user, bar user, baz user -> Joel's connection -> Joel How can I represent this in the database. If I model as, User Id PK Name Char Connecti...

working with database Best practise?

I have a C# database layer that with static read method that is called every second in background timer. currently I create SqlCommand, SqlConnection once as a class memeber. In every method call I execute the command to get the results,I am doing so to avoid creation of connection and command every second, but I am afraid from except...

Django users and authentication from external source

I have a Django app that gets it's data completely from an external source (queried via HTTP). That is, I don't have the option for a local database. Session data is stored in the cache (on my development server I use a SQLite database, so that is no error source). I'm using bleeding edge Django 1.1svn. Enter the problem: I want to use ...

Synchronization with master database

I have a 2 databases hosted on the different server. What the best thing do, to copy all the contents of master table database to the table of slave database? I am not the owner of the master database but they are willing to give an access. Before the data from master database is outputted via RSS and my PHP script parse it to insert int...

restore the database

how can we get the restore in sql server 2000 of sql server 2005 data ...

.Net: how to create vendor independent Dataset, Tableadapters, bindings (DB decided at runtime)

I have a C# Windows Forms application, whose prototype was created on SQL Server (strongly-typed dataset). In its final version, the application must be able to work over SQL Server, MySQL or Oracle. Now I am wondering which parts (if any) can be reused from the prototype. 1. Dataset (typed) ? 2. TableAdapters? (probably not, they conta...

Key-value database for .NET

Is there a good, scalable key-value database for .NET? Something like BerkeleyDB or Tokyo Cabinet? Specifically, it should allow to store large number of entries, which are mostly binary blobs. I'm fine if it is just a C-wrapper around some native database, as long as binaries for Win x86/x64 and Linux are available. Of course, a purely...

sql 2005 - The column was specified multiple times

Hi, I am getting the following error when trying to run this query in sql 2005: SELECT tb.* FROM ( SELECT * FROM vCodesWithPEs INNER JOIN vDeriveAvailabilityFromPE ON vCodesWithPEs.PROD_PERM = vDeriveAvailabilityFromPE.PEID INNER JOIN PE_PDP ON vCodesWithPEs.PROD_PERM = PE_PDP.PEID ) AS tb; Error: Th...

If I wanted to authorize connections between my client apps.. how would i?

Hi, I am trying to figure out how to handle authentication and data for client applications who will connect to eachother. In other words, each client app would authenticate to.. and use a central service to find out info about the other client so that they can connect directly. Specifically, what should I deploy to accomplish this and...

Caching moderate amounts of data in a web app - DB or flat files?

A web app I'm working on requires frequent parsing of diverse web resources (HTML, XML, RSS, etc). Once downloaded, I need to cache these resources to minimize network load. The app requires a very straightforward cache policy: only re-download a cached resource when more than X minutes have passed since the access time. Should I: S...

Retrieving the latest note (by timestamp) in a single query from a 1:n table

Let's say I have two tables, users and notes. Let's say the schemas look like this: users id, name, field2, field3 notes id, user_id, subject, heading, body, timestamp What I want to do is select every user, and the LATEST (just 1) note posted by each user based on the timestamp to show in an overview report. How would I go about d...

jquery pop up box, Pull from a database RoR

Alright. I'm working in Ruby on Rails and what I have is a table the is being pulled from a database like so. <% @businesses.each do |business|if !business.approved %> <tr> <td><div class="button<%=h business.name %>"><a href="#"><%=h business.name %></a></div></td> <td><%=h business.address %></td> <td><%=h busin...

PostgreSQL: Defining a primary key on a large database.

I am planing a database to store lots of text. (blog posts, news articles, etc.) The database needs to have the title, content (50k characters max), date, link and language fields. The same content can't occur on one link. Old content (older then 30 days, for example) will be deleted. Now, the problem is the primary key. I could just se...

Storing Array of Floats as a BLOB in Oracle

I am designing a new laboratory database. For some tests, I have several waveforms with ~10,000 data points acquired simultaneously. In the application (written in C), the waveforms are stored as an array of floats. I believe I would like to store each waveform as a BLOB. Questions: Can the data in a BLOB be structured in such a w...

Column with same name in multiple tables causing problem in SubSonic Select.

Hi folks, there are other question (at least 2 I've seen them) similar to this but I'm not able to solve this using them. Now the problem: I've 3 table from which I need to select 4 columns only. I'm using InnerJoin and it is working perfectly. Problem starts when I add a Where to this Select. I've a column named "Name" in two tables. I...