database

How do I make software that preserves database integrity and correctness?

I have made an application project in Visual Studio 2008 C#, SQL Server from Visual Studio 2008. The database has like 20 tables and many fields in each. I have made an interface for adding deleting editing and retrieving data according to predefined needs of the users. Now I have to Make to project into software which I can deliver...

How to properly manage a complex DB structure?

Let's say you have several systems using the same DB - each uses several schemes (sometimes same as the other). This structure of these schemes is somewhat very big and complicated. Now, how could you possibly manage such scheme structure? Obviously using some sort of "configuration" - the simplest would be SQL scripts, but a more reaso...

Adding db file to visual web developer

Hi, I'm beginner in visual web developer. I want to add a ready database to my project, to do that I simply add the db file to App_data folder. However, I can't see any table or database diagram etc. Am I missing a big part to add external source ? Any help? I'd appreciate it ...

ASP.NET configure data source is not returning anything?

I'm selecting table data of the current user: SELECT [ConfidenceLevel], [LoveLevel], [HappinessLevel] FROM [UserData] WHERE ([UserProfileID] = @UserProfileID) I have set a control to the unique user ID and it is getting the correct value: HTML: <asp:Label ID="userID" runat="server" Text="Labeluser"></asp:Label> C#: userID.Text = M...

Berkeley DB java edition, any LGPL or BSD alternatives in Java?

Hi All, I am dealing with a huge dataset consisting of key-value pairs. The queries are always in the form of range queries on the key space (keys are numbers) hence any persistent B-Tree like structure will handle the situation. I would like to use BDB-Java Edition but the product is closed source and my company doesn't want to buy BDB...

What is best practice for working with DB in Wordpress?

I'm developing a plugin for Wordpress, and I need to store some information from a form into a table in the DB. There are probably lots of pages explaining how to do this, this being one of them: http://codex.wordpress.org/Function_Reference/wpdb_Class But are there any other pages talking about best practice for interacting with th WP...

Is there anyway to change the database server without stopping the database?

I have a database in data center, which is running MySQL, and I want to change the database from data center to host in my company. At that time, I don't want to stop the data base in the data center, is there anyway to this kind of integeration? Thank you... ...

Why qry.post executed with asynchronous mode?

Recently I met a strange problem, see code snips as below: var sqlCommand: string; connection: TADOConnection; qry: TADOQuery; begin connection := TADOConnection.Create(nil); try connection.ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Test.MDB;Persist Security Info=False'; connection.Open(); qr...

filter duplicates in SQL join

When using a SQL join, is it possible to keep only rows that have a single row for the left table? For example: select * from A, B where A.id = B.a_id; a1 b1 a2 b1 a2 b2 In this case, I want to remove all except the first row, where a single row from A matched exactly 1 row from B. I'm using MySQL. ...

Multiple OR Clauses in MySQL

I'm trying to grab content where id = 3 OR id = 9 OR id = 100... Keep in mind, I can have a few hundred of these ids. What is the most efficient way to write my query? $sql = "SELECT name FROM artists WHERE (id=3 OR id=9 OR .... id-100)" ...

Simple Database normalization question...

Hi all, I have a quick question regarding a database that I am designing and making sure it is normalized... I have a customer table, with a primary key of customerId. It has a StatusCode column that has a code which reflects the customers account status ie. 1 = Open, 2 = Closed, 3 = Suspended etc... Now I would like to have another f...

Making Postgres SQL minimal size. How?

I want to cut Postgres to its minimal size for purpose of including just database function with my application. I'm using Portable Postgres found on internet. Any suggestions what I can delete from Postgres installation which is not needed for normal database use? ...

Java login form with database connection

I am creating a login form in java by having a database connection, and I need 2 open DIFFERENT forms for each user. However, all of the three forms open except for one. The forms I have are, MAinWindow Nursery Primary Secondary ALL THE FORMS OPEN except for the nursery form, when I enter the correct username it displays the Primary for...

Free DBMS with encryption support and without size limitations

I really need a free database which supports encryption, but doesn't have size limitations like 4 GB in SQL Server Express. Suggestions welcome! ...

Relational databases are not suited for my application - what's the alternative?

Hi, I'm writing a CMS in PHP that allows the user to define different fields (e.g. a Blog page could have fields for Title (string), Content (rich text), Picture (file)). I need the user to be able to add and remove fields dynamically, and the only way I can think of to do it with relational DBs is to serialise all these values and stor...

Representing complex scheduled recurrence in a database

I have an interesting problem trying to represent complex schedule data in a database. As a guideline, I need to be able to represent the entirety of what the iCalendar -- ics -- format can represent, but in a database. I'm not actually implementing anything relating to ics, but it gives a good scope of the type of rules I need to be abl...

2 Select or 1 Join query ?

I have 2 tables: book ( id, title, age ) ----> 100 milions of rows author ( id, book_id, name, born ) ----> 10 millions of rows Now, supposing I have a generic id of a book. I need to print this page: Title: mybook authors: Tom, Graham, Luis, Clarke, George So... what is the best way to do this ? 1) Simple join like this: Select...

Creating an appropriate index for a frequently used query in SQL Server

In my application I have two queries which will be quite frequently used. The Where clauses of these queries are the following: WHERE FieldA = @P1 AND (FieldB = @P2 OR FieldC = @P2) and WHERE FieldA = @P1 AND FieldB = @P2 P1 and P2 are parameters entered in the UI or coming from external datasources. FieldA is an int and highly n...

Add new row in a databound form with a Oracle Sequence as the primary key

I am connecting C# with Oracle 11g. I have a DataTable which i fill using an Oracle Data Adapter. OracleDataAdapter da; DataTable dt = new DataTable(); da = new OracleDataAdapter("SELECT * FROM Author", con); da.Fill(dt); I have few text boxes that I have databound to various rows in the data table. txtAuthorID.DataBindings.Add("Tex...

MySQL or SQL Server

I'm creating an application that I want to run on either MySQL or SQL Server (not both at the same time) I've created two PHP classes DatabaseMySQL and DatabaseSQLSVR and I'd like my application to know which database class to use based on a constant set up at install. define(DB_TYPE, "mysql"); // or "sqlsrv" I'm trying to think of the...