database

ADO.NET Multiple simultaneous reads from an open database.

Answer not needed - my logic was wrong and this question is invalid. Charles helped me see where I went off-tracks. Thanks I have a utility that moves data from one source to another. In the process of writing the record I check to see if it exists and do an update/insert as necessary. The difficulty I have is that as I'm writing th...

Data Access Layer, Best Practices

I'm looking for input on the best way to refactor the data access layer (DAL) in my PHP based web app. I follow an MVC pattern: PHP/HTML/CSS/etc. views on the front end, PHP controllers/services in the middle, and a PHP DAL sitting on top of a relational database in the model. Pretty standard stuff. Things are working fine, but my DAL is...

On Redirect - Failed to generate a user instance of SQL Server...

Hello (this is a long post sorry), I am writing a application in ASP.NET MVC 2 and I have reached a point where I am receiving this error when I connect remotely to my Server. Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user ...

WPF Embedded Database Application

Hello everyone, im new with wpf and want to make a small Application with the embedded (local) database in WPF. Im using VS08, ->add new file -> local Database, so far so good. I also can add a table (test table called Person with Name and Age), this works good. And now comes my problem, could anyone tell me how to make (select... inser...

SQL Server 2005 Convert Ascii to Unicode (UTF-8 -> nvarchar)

I have data in an nvarchar field with data in ascii format: "Zard Frères Guesta" How do I convert it to a readable(unicode) format in t-sql? ...

Set database based on how the application was started

I have two Rails applications (lets call them APP-1 and APP-2), each of them has a dependancy on a third Rails application (APP-3). I would like to be able to run the tests for APP-1 and APP-2 in parallel on my CI server. The problem is, both need to start up APP-3 and write to a DB via the APP-3. This causes conflicts and failures ...

Python and database

Hello.. I am working on a personal project where I need to manipulate values in a database-like format. Up until now I have been using dictionaries, tuples, and lists to store and consult those values. I am thinking about starting to use SQL to manipulate those values, but I don't know if it's worth the effort, because I don't know an...

GridView edit problem If primary key is editable (design problem)

I would like to ask about the design of table based on it's editability in a Grid View. Let me explain. For example, I have a table named ProductCustomerRel. Method 1 CustomerCode varchar PK ProductCode varchar PK StoreCode varchar PK Quantity int Note text So the combination of the CustomerCode, StoreCode and ProductCode must be u...

Best way to store data in database when you don't know the type

I have a table in my database that represents datafields in a custom form. The DataField gives some representation of what kind of control it should be represented with, and what value type it should take. Simplified you can say that I have 2 entities in this table - Textbox taking any string and Textbox only taking numbers. Now I have...

Web Shop Schema - Document Db

I'd like to evaluate a document db, probably mongo db in an ASP.Net MVC web shop. A little reasoning at the beginning: There are about 2 million products. The product model would be pretty bad for rdbms as there'd be many different kinds of products with unique attributes. For example, there'd be books which have isbn, authors, titl...

What is difference between this two C# methods

What is the difference between these two cases. Firstly, if I open the connection and pass it into my method as a parameter, compared to opening the connection directly in the method? cnn.open() func(cnn,param1,param2); vs func(cnn, param1,param2) { cnn.open(); //open connection here } ...

(Doctrine-Ubuntu) Get error: doctrine-cli.php: command not found

Hi, (Doctrine-Ubuntu) I run $ doctrine-cli.php command and get doctrine-cli.php: command not found. P ...

DAO method retrieve single entry

Hello, How can I write DAO method which will return as a result only first entry from the database. For instance lets say I'm looking at Users table and I want to retrieve only the first entry, I'd declare method like: public User getFirstUser(){ //method logic } EDIT: User has primary key id if that matters at all. I apologize...

two databases in one controller cakePHP

I'm having trouble creating a page, which requires two different databases.. The controller is automaticly set to 'DB2', which is also specified in the database config file. When i add a var $uses = array ('groups') to the controller, which is from the other DB (DB1), i get the data from only DB2 and all requests to DB1 become a inval...

django insert data from 2 tables using a single ModelForm

Hi there, I want to get data from 2 tables into a form using ModelForm, like this: fist model: class Cv(models.Model): created_by = models.ForeignKey(User, blank=True) first_name = models.CharField(('first name'), max_length=30, blank=True) last_name = models.CharField(('last name'), max_length=30, blank=True) url = mo...

Ignore records marked as deleted in navigation properties in EF 4.0

Hi, I have added a column 'IsDeleted' to every entity in my Entity Framework 4.0 model and implemented an Interface for it. How can i accomplish that the entities with 'IsDeleted' set to 'true' are ignored by all Objectsets and Navigationproperties in my model? Filtering the result using LinQ does not work i think, because the result ca...

create object output stream from an object

Hi, I want to create on ObjectOutputStream, but I don't want to persist the object in a file, so how to do that? All the tutorials(that I found) say only about the file way: FileOutputStream fos = new FileOutputStream("t.tmp"); ObjectOutputStream oos = new ObjectOutputStream(fos); oos.writeObject(new Date()); ...

jquery ui autocomplete database

Hello, I'd like to use jQuery UI autocomplete in order to load a list from my database but I don't know wich method I should use to do so. I tried to use the "Remote datasource" method http://jqueryui.com/demos/autocomplete/#remote, but it obviously doesn't work. I have the following code : js: $(function() { $("#client").autoco...

Has inheritance become bad?

Personally, I think inheritance is a great tool, that, when applied reasonably, can greatly simplify code. However, I seems to me that many modern tools dislike inheritance. Let's take a simple example: Serialize a class to XML. As soon as inheritance is involved, this can easily turn into a mess. Especially if you're trying to serializ...

WebApp Password Management - Hashing, Salting, etc...

Hi there. Im searching for the most secure (but yet doable) way of password management in a web app. Right now, I save the password as hash. The DB account of the app is restricted to excecution of stored procedures and I authenticate users by giving the username and the hashed password to a stored procedure that returns 1(true) or 0(...