database

how to fetch just 1 row from an object

this query will just one row as a result myDataContext db = new myDataContext(); var query = from u in db.users where u.userId == myUserId select u; I usually get the result out from the "query" object by using "foreach" foreach(var i in query){ username = i.username; } ...

Is there a simple way to do GUI input for a relational database?

I'm building a student rostering application for a friend and I'm just about done except for the GUI. I'm writing it in wxpython but I'm not sure how to proceed with the input fields because it is a relational database. Is there a simple way to do this? ...

Why does an Entity Framework Connection require a metadata property?

I switched my DAL from using LINQ over to Entity Framework. Because my application connects to different databases depending on the current user, I need to dynamically create the DataContext at run time and pass in the appropriate connection string. However, when I tried to programatically create an Entity Framework connection using my...

Predicting Oracle Table Growth

How can I predict the future size / growth of an Oracle table? Assuming: linear growth of the number of rows known columns of basic datatypes (char, number, and date) ignore the variability of varchar2 basic understanding of the space required to store them (e.g. number) basic understanding of blocks, extents, segments, and block ov...

Resolve many to many relationship

Does anyone have a process or approach to use for determining how to resove a many-to-many relationship in a relational database? Here is my scenario. I have a group of contacts and a group of phone numbers. Each contact can be associated with multiple phone numbers and each phone number can be associated with multiple contacts. A si...

complex query using LINQ and C#

hello I have a very big problem solving this issue I have 2 tables first table is : which contains a modules (id and name) second table is which contains users ids and their preferred modules' numbers now lets move to the problem I want to generate a list of checkboxes for example for the userid 1 which has the following module...

best practice for create database for Versioning System like CMS

Hi, I am working with system like CMS that need to versioning documents. what is best practice and methodology for create database for it with any how its table? ...

How to save a particular, mutable "order" into a Database

Suppose I have some objects, and I want the user to be able to reorder them in any way they wish, say, by dragging them around. So I'd have cheese muffins milk and then the user drags 'milk' to the top, making the new order milk cheese muffins Is there a best practice how to store the order of these objects in a database? The nai...

Intranet back-office data on the webserver?

I am upgrading a client's e-commerce webstore and have hit a bit of a snag. The store is a custom-made set of PHP scripts. At each sale, the credit card is charged via the merchant account interface, and then the order is e-mailed to the client's desktop INBOX. However, as the company grows, this became unscalable, as the client spends ...

Migrating an Oracle database with a C# application attached to it: How to manage database migration?

I have a C# application which works with an Oracle database and has been already shipped. Now it's time to ship out a new release. The C# object model have been revised and had an impact on the table structure. If I ship out the new release, I need to take care of existing data. Just dropping tables and recreate these tables wouldn’t ma...

How to build a simple recommendation system?

How to build a simple recommendation system? I have seen some algorithms but it is so difficult to implement I wish their is practical description to implement the most simple algorithm? i have these three tables Users userid username 1 aaa 2 bbb and products productid prod...

Timezone considerations in sql server

Hi, I'm using an sql server 2005 hosted in the states. Soon we will move the db to Europe. I'd like to update the dates in the db to take into account the timezone difference. Is there a good way to do this? Or is it just a case of looping through the dates and adding the timezone offset? ...

MySQL NOT LIKE query not working

I have 2 tables: posts tags Tags table is structured like this: post_id tag So for every tag that's given for a post, I create a record in the tags table. If a post has 10 tags, there will be 10 records in tags table with that post_id. I'm now trying to build a search page where users can do a search for posts where tags do not ...

Invalid parameter error with TClientdataset

What is the reason for getting an 'invalid parameter error' when calling the CreateDataSet method in a TClientDataSet component. What causes this error. Kind Regards Riaan de Villiers ...

When I should use stored procedures?

Is it always good to use stored procedures , is it good for database performance and what kind of queries that you better use stored procedures? Exact Duplicate: When should you use stored procedures? ...

Database: To delete or not to delete records

I don't think I am the only person wondering about this. What do you usually practice about database behavior? Do you prefer to delete a record from the database physically? Or is it better to just flag the record with a "deleted" flag or a boolean column to denote the record is active or inactive? ...

How do I test a code generation tool?

I am currently developing a small project of mine that generates SQL calls in a dynamic way to be used by an other software. The SQL calls are not known beforehand and therefore I would like to be able to unit test the object that generates the SQL. Do you have a clue of how would be the best approach to do this? Bear in mind that ther...

Datastructures used in DBMS

What are the datastructure used in DBMS like Oracle,MySQL & Sqlite for storing and retrieving records. ...

How to deal with SQL Server from native C++ on the Windows platform?

Is there any solution other than the ugly ADO as it is not good and badly documented? ...

Database deployment best practices

Mostly we change existing database tables, stored procedures, functions or parameters in tables for software upgrades/bugfixes. And when it's time to deploy our changes to another environment like production or preproduction, some parts of our db changes are forgotten. In our company, some developers use a database difference analysis a...