database

ado.net Concurrency violation

My first time using ADO.net. Trying to make database of Users. First I populate my DataSet: adapter.AcceptChangesDuringFill = true; adapter.AcceptChangesDuringUpdate = true; adapter.Fill(dataset); To create a user: User user = new User(); user.datarow = dataset.Users.NewUsersRow(); user.Name = username; user.PasswordHash = GetHash(...

Should we use Visual Studio 2010 for all SQL Server Database Development?

Our company currently has seven dedicated SQL Server 2008 servers each running an average of 10 databases. All databases have many stored procedures and UDFs that commonly reference other databases both on the same server and also across linked servers. We currently use SSMS for all database related administration and development but ...

MySQL Throws NullReferenceException in Finalize... How are you coping with this?

I am using MySQL with the .Net connector on 64 bit Windows. For some reason Mysql is throwing a NullReferenceException in Finalize. This is the problem here and it seems that its due to a bug described here. This bug was reported in 6.22, but I am getting the issue with 6.23 too so apparently it is not fixed. I am using MySQL both with ...

How do I query table data only for the current user's ID (VWD asp.net 3.5) ?

I'm using the Details View control of VWD asp.net 2008 I have a users database table. One of the columns contain the "uniqueidentifier" user's profile ID, created by VWD (from the automatic profiles table). From my table, I would like to select only the data pertaining to the logged in user. How do I get the current unique user ...

Populate an SQL Server 2k8 with Oracle Loader files

Hi folks. Here's the problem: I have a project that needs to be migrated to Microsoft SQL Server 2008. We have data in text files for the Oracle SQL Loader and now we need to get that data into the SQL Server DB. I could write a program that converts everything into INSERT statements but there has to be a more comfortable way to so t...

Map null column as 0 in a legacy database (JPA)

Using Play! framework and it's JPASupport class I have run into a problem with a legacy database. I have the following class: @Entity @Table(name="product_catalog") public class ProductCatalog extends JPASupport { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) public Integer product_catalog; @OneToOne @Jo...

Can we take backup of our current database through java programming ?

Can we take backup of our current database through java programming ? ...

Open/Close database connection in django

I am using Django and Postgresql as my DBMS. I wish to set a setting that enables to enable/disable database connection. When the connection is set to closed (in settings.py) the site will display a message such as "meintanence mode" or something like that. Django will not show any db connection error message (or mail them to admins). I...

Linq-To-Sql - Portability Problem

I've created an ASP.NET solution on my computer. There is a business layer in the project, which uses Linq-To-Sql for Database operations. How can I open the same project on another computer? I am having problems, becuse of connection string or etc. ...

how to get result from this data.

I want to compute result from this table. I want quantity 1 - quantity2 as another column in the table shown below. this table has more such records I am trying to query but not been able to get result. select * from v order by is_active desc, transaction_id desc PK_GUEST_ITEM_ID FK_GUEST_ID QUANTITY TRANSACTI...

How to optimize paging for large in memory database

I have an application where the entire database is implemented in memory using a stl-map for each table in the database. Each item in the stl-map is a complex object with references to other items in the other stl-maps. The application works with a large amount of data, so it uses more than 500 MByte RAM. Clients are able to contact th...

Java: Storing information from database. What collections are appropriate?

I write an application in Java. I get form a database a table (clients) which contains fields like: name | surname | adress What is the best solution to store this data in my app? Should I create an object for each client and store these objects in a list or set? The table contains about 100 records and it's already sorted. Thanks ...

Best way to bundles photos with app: files or in sqlite database?

Lets say that I have an app that lets you browse through a listing of cars found in a Sqlite database. When you click on a car in the listing, it'll open up a view with the description of the car and a photo of the car. My question is: should I keep the photo in the database as a binary data column in the row for this specific car, or ...

How to choose light version of database system

I am starting one POS (Point of sale) project. Targeting system is going to be written in C# .NET 2 WinForms and as main database server We are going to use MS-SQL Server. As we have a lot of POS devices in chain for one store I will love to have backend local data base system on each POS device. Scenario are following: When main serve...

Save XML directly to Database with C#

Here is a part of my xml file <teams> <team-profile> <name>Australia</name> <id>1</id> <stats type="Test"> <span>1877-2010</span> <matches>721</matches> <won>339</won> <lost>186</lost> <tied>2</tied> <draw>194</draw> <percentage>47.01</percentage> </stats> <squad> <pl...

How to translate this 2 queries from Mysql to Postgresql? :

How can I translate this 2 queries in postgresql ? : CREATE TABLE `example` ( `id` int(10) unsigned NOT NULL auto_increment, `from` varchar(255) NOT NULL default '0', `message` text NOT NULL, `lastactivity` timestamp NULL default '0000-00-00 00:00:00', `read` int(10) unsigned NOT NULL, PRIMARY KEY (`id...

DataSet v/s Database

While designing applications it is a very good practice to have all the business logic in one place. So why then we sometimes have the business logic in stored procs? Can we fetch all data from the DB and store it in a DataSet and then process it? What would be the performance of the app in this scenario? ...

Database structure, optimizing table with lots of rows

I have a table with a lot of rows. The structure is something like this: UserID | ItemID | Item Data... Would I see any gains in query time if I separated this into a table per user, or per smaller group of users? Queries are always single user getting/modifying a selection of items. ...

How to insert hyperlink into access database via sql?

I have a fairly simple MS Access Database that contains some metadata about a bunch of documents and a hyperlink field that links to the document on our network drive. However, when I use a SQL INSERT statement to populate the hyperlink field, the value I give it only becomes the display text, not the actual link. How can I make the va...

Problems with large MySQL tables

Hello guys, I'm having some problems with large MySQL tables. The tables are in MyIsam type and some queries can take up to 15 seconds. These tables are mostly read, so this is becoming a problem. My guess is that the software is issuing slow/poorly written queries to the database. Example: implicit joins x explicit joins. If i rewrite...