Click here to Skip to main content
15,885,365 members
Everything / Database Development

Database Development

database

Great Reads

by Evoluteur
Generic REST or GraphQL endpoints for CRUD and more, written in JavaScript, using Node.js, Express, and PostgreSQL
by Aleksandr Ulanov
Learn how to use Redis and its geospatial indexes and commands for complex geo calculations
by Rob Culhane
How to dynamically add access database columns at runtime using VB.NET
by Paul D. Sheriff
As more and more users interact with web applications on their mobile devices, it is becoming increasingly important for software developers to allow them to work offline; PouchDB can help.

Latest Articles

by Nicolas DESCARTES
What are vector databases?
by Ștefan-Mihai MOGA
How to solve real-life problems using B-trees
by Mark Pelf
Showing problems with limited accuracy of SqlServer data type “datetime” in .NET7 EF7 environment
by Mark Pelf
Tutorial on EF7 – Code First approach using Command Line (CLI)

All Articles

Sort by Score

Database Development 

11 May 2022 by Evoluteur
Generic REST or GraphQL endpoints for CRUD and more, written in JavaScript, using Node.js, Express, and PostgreSQL
3 Jan 2013 by WebMaster
I guess you can do by this way: At server-side, you define some web services.At Android application, you define servie that run in background, and invoke to those web servies in a interval you defined before.To invoke web services from Android application, you can use open source lib named...
10 Aug 2022 by Aleksandr Ulanov
Learn how to use Redis and its geospatial indexes and commands for complex geo calculations
21 Apr 2013 by Rob Culhane
How to dynamically add access database columns at runtime using VB.NET
15 Jan 2019 by Paul D. Sheriff
As more and more users interact with web applications on their mobile devices, it is becoming increasingly important for software developers to allow them to work offline; PouchDB can help.
16 Oct 2017 by Nikola M. Živković
Introduction to NoSQL and Polyglot Persistence
19 Feb 2015 by DrABELL
Technique to extend capability of standard SQL by adding the Aggregate Product Function
22 Oct 2014 by essentialSQL
Database normalization in SQL explained in simple English
16 Apr 2013 by Sergey Alexandrovich Kryukov
If your XML file is small enough to keep all the data in memory, this is a simple easy way to implement a kind of a database; and you would enjoy the huge benefits of purely object-oriented database, no mapping code. If this is not the case, however, such approach would be very awkward, and I...
23 Mar 2019 by Minh Tuan Do
A considerable method to speed up query running time
4 Apr 2021 by Rijwan Ansari
Learn about SQL Server Database Project (Template) available in VS
19 Feb 2010 by Md. Marufuzzaman
This is good... You can also consider this link.[^]
7 Jan 2012 by Sergey Alexandrovich Kryukov
I would recommend this simple, clear, short an informative CodeProject article for beginners: Using ADO.NET for beginners[^].—SA
9 Feb 2014 by Sergey Alexandrovich Kryukov
The question makes no sense at all, because you did not tell anything about the goals of the software you need to have.As you mentioned that you want to "create" software, it sounds like you would need to find open-source software to learn how to do programming (otherwise you would know...
28 Jul 2014 by DiponRoy
How to manage Entity Framework Code First in Real Time Projects
27 Jan 2015 by Vaclav Naydenov
Comparing the performance of two similar CRUD server apps, one written in Python and SQLAlchemy, the other in C++ and YB.ORM.
29 Dec 2016 by essentialSQL
Introduction to cross join - create row combinations
8 Jun 2023 by Mark Pelf
Showing problems with limited accuracy of SqlServer data type “datetime” in .NET7 EF7 environment
26 Jan 2011 by Sergey Alexandrovich Kryukov
This is called "Cluster analysis", your problem is probably the most elementary one.I don't know your chances to find anyone who has some ready-to-use code or algorithm, but you can start with this article, just to get and idea what's...
4 Feb 2012 by RasikaLB
You can find queries to find a specific string from MSSQL Server
20 Jun 2013 by Levente Kupás
If you have big reports which run slowly, you may use this T-SQL based engine to speed-up them.
19 Jun 2015 by ergohack
System.Data.SQLite is great, but was missing some BLOB support. Switching to the native source project was easier than expected and provided significant functionality benefits.
27 Jun 2016 by Val Okafor
Realm Database Tutorial For Android – Part 1
8 Jan 2019 by RickZeeland
Instead of sending lots of commands you could try sending one command using the "IN" clause, see example here: SQL IN Operator[^]
21 May 2021 by rev78
Simply bypass the 255 columns in MFC CRecordset
22 Nov 2021 by Michael Sydney Balloni
Wanna add basic database functionality to your C++ app? Too lazy to use SQLite directly? Read on!
15 Mar 2011 by Sergey Alexandrovich Kryukov
I'm sure the only valid answer would be this: http://en.wikipedia.org/wiki/Comparison_of_database_tools[^].That leaves for your choice from this table, which is entirely defined by your purpose :-)Honestly.—SA
25 May 2011 by Manfred Rudolf Bihy
DBMS are relational and so should be your data model.This is what I would do:TABLE_WebPage------------integer id; //primary auto increment keyvarchar(50) name; //maybe UNIQUE index on that onevarchar(300) url;...TABLE_PageMetaTag------------------integer id;...
6 Jul 2012 by OriginalGriff
That's going to depend on what you have them as in your app. If they are images as seems likely, then varbinary(max) would be a good choice. If they need additional info then you might want to store them in two fields to make separating them before use easier.
18 Aug 2012 by _Amy
Hi,Try adding this when login is successful:if (dr.HasRows == true){ MessageBox.Show("Login Successfull", "Login Information"); this.Hide(); //This will hide your current form MyWinForm1 M1 = new MyWinForm1();//Create the object of your second form ...
3 Nov 2014 by essentialSQL
Database Third Normal Form explained in simple English
19 Jan 2016 by essentialSQL
How to Write SQL – Understand Database Table Meanings and Relationships – Step 1
10 Feb 2016 by Jesus Carroll
SQL Server 2016 introduces support for system-versioned temporal tables as a database feature that brings built-in support for providing information about data stored in the table at any point in time rather than only the data that is correct at the current moment in time.
31 Jan 2017 by #realJSOP
Using common table expressions to build data from thin air.
30 Dec 2019 by Dathuraj Pasarge
Database mirroring setup without any DBA effort - on every new database creation
26 Sep 2010 by Henry Minute
Well, yes and no. :) For example in an employee table that includes a manager attribute, one solution to discovering the hierarchy is to use a self join which can result in a cartesian product.So yes, because there would only be one table. No because it is being treated as two tables for...
6 Jan 2011 by OriginalGriff
Yes. Sort of.You would have a ConnectionString which supplies the address and login details for the database, but after that you need to supply code or browser html to access the database itself and enter / extract the records.Note I would suggest that for the DB you look at MsSql or...
20 Jan 2011 by OriginalGriff
Try:INSERT INTO "table_name" ("column1", "column2", ...) VALUES ("value1", "value2", ...)as your SQL command. By preference, do it using Parameterised queries:cmd = new SqlCommand("INSERT INTO PatientDetails (Name, HeartScore) VALUES (@NAME, @HEARTSCORE)",...
9 Feb 2011 by Espen Harlinn
I think this is what you are looking for:Limiting Result Sets by Using TABLESAMPLE[^]RegardsEspen Harlinn
15 Feb 2011 by Sharma Richa
SELECT TOP(2) * FROM [tablename] ORDER BY Id DESCsecond isSELECT TOP(5) * FROM [table] ORDER BY salary DESC
24 Mar 2011 by Espen Harlinn
Take a look at:WPF DataGrid Practical Examples[^]RegardsEspen Harlinn
6 Apr 2011 by Dylan Morley
SQL Express 2005 should be fine for what you're trying to achieve. What you need to think about here is how the SQL instance is exposed over the network and how clients are going to connect to it. This is going to be the same issue for any RDBMS you might choose, such as MySql[^]For...
6 Apr 2011 by Wendelius
Hi,The choice depends on many different factors, like:- performance requirements- underlying OS- upgradability- licensing issues (possible existing licenses at client etc)- estimated size in 1,2,5 years- number of (concurrent) users/transactions etcIf you were unable to...
18 Apr 2011 by OriginalGriff
Do you want the bad news? Sorry, but SQL does not behave the same as C, C++ and C#. In those, AND clauses are always executed left - to right, and any false result will abort the operation (called "evaluation short-circuiting"). SQL does not do that. What it does do is more complex. There is a...
19 May 2011 by CS2011
There is no hard and fast rule for this. This depends on many criteria like what is database (i.e Oracle, DB2,Sql server etc ) and what is the operation performed inside the SP(insert/update or just a select). In case of select opration inside SP the SP may execute over multiple threads(this is...
24 Aug 2011 by Herman<T>.Instance
the value of FoodName in c# is NULL. How is FoodName set when not found in item?read my article about disadvantages of sqlparameters.Disadvantages of SqlParameters Turned into Advantages[^]you need somethind like this:private static void CheckParameters(List...
13 Sep 2011 by Mehdi Gholam
The general principal to keep in mind is don't make more work for yourself than is absolutely necessary. Most clients and users don't care about how and where their data is stored unless it is safe and consistent. Rarely to client insist on using a specific type of database engine.In...
24 Sep 2011 by Sander Rossel
I partly agree. I do not quite get your "SP's are not faster" point. You make Command Objects with query strings? You pass to them Parameter Objects so you have a parameterized query? If you go at it that way I can imagine there is no speed penalty, since that approach simply executes the query...
6 Feb 2012 by Espen Harlinn
Have a look at:WPF: A* search[^]It does most of what you actually need. Best regardsEspen Harlinn
26 Nov 2013 by Maciej Los
I would suggest you to use Stored procedure instead command text in a code behind.Please, see: Return Data from a Stored Procedure[^]How to: Execute a Stored Procedure that Returns Rows[^] SP should looks like this one:SELECT *FROM [users]WHERE [name]=@usernameBy The Way: Do...
7 May 2014 by Kornfeld Eliyahu Peter
You can use DBTIMEZONE or SESSIONTIMEZONE for that...http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions143.htm[^]http://psoug.org/definition/DBTIMEZONE.htm[^]
30 Jul 2014 by DiponRoy
How to handle database scheme changes with normal SQL scripts, without migration in Entity Framework code first
4 Sep 2014 by Wendelius
This sounds a bit like a homework....Anyhow, there are quite a few differences. To name some from the top of my head:the amount of columns is differentthe order of the same columns returned may be differentthe second one may fail because of wrongly typed column namethe second one may...
21 Oct 2014 by essentialSQL
Database Second Normal Form explained in simple English
7 Sep 2015 by Sander Rossel
The seventh in a series on MEAN web development.
11 Jul 2016 by Jesus Carroll
Despite the references of several sources of unattended installation of Microsoft SQL Server Database Engine, in this article describes a script tested in real production environments and it can be used with minimal or - perhaps - no modifications.
14 Jul 2016 by OriginalGriff
If I do a dummy setup and test on your code:public class MachineAD { public string Name; public int ID; }public class Machine { public string BarCode; }public class MachineUnified { public int IDad; public string NameFromAD; public...
17 Nov 2016 by Richard Deeming
As I suspected, you're sharing a single OleDbConnection instance across multiple calls. All of the errors you're describing are caused by multiple threads trying to access that single object at the same time.For example:Thread 1: Gconn = New OleDb.OleDbConnectionThread 1:...
18 Dec 2016 by NightWizzard
Convert amounts to their spoken equivalents
8 Feb 2017 by #realJSOP
I would create two tables - One with patient identifying information, and the other with all other fields.This will make it easier to satisfy HIPAA requirements later.Table PHI:PatientID (this should be the biggest integer type supported by your...
24 Feb 2019 by CHill60
It is highly unlikely that you need to use a loop of any kind. My article Processing Loops in SQL Server[^] offers several worked examples with alternatives to loops. In this case you need to identify the individual timeslots that exist on the production table e.g. create table #timeslots (id...
6 Jul 2019 by MadMyche
There are most likely multiple errors in your statement. The main issue I see is a major vulnerability known as SQL Injection. You should NEVER EVER piece user entered data asstrings together to form a SQL statement. The proper way to add variables into a command is via Parameters string sQry =...
8 Jan 2022 by Michael Haephrati
A Static Library which can be used for all kinds of database related needs
1 Nov 2022 by Tomas@PawSQL
How to cope with all scenarios regarding NULL value handling in your daily work
2 Mar 2023 by Lee P Richardson
Deploy EF database migrations while avoiding security flags
17 Mar 2024 by Graeme_Grant
You would use a CollectionViewSource and use grouping. I assume that you are using WPF. Here is a sample: How to: Sort and Group Data Using a View in XAML - WPF .NET Framework | Microsoft Learn[^]. Hereare some more things that you can do with...
18 Dec 2009 by Vinayaka Krishna Shenoy
Hello,Ye...
25 Oct 2010 by Nish Nishant
There are two approaches to take:1) Store the mp3 content directly in the DB. This is probably not a great idea. Most databases will have some kind of blob field type that you can use for this.2) Store file paths to the actual mp3 content, which will remain as physical files on a server.
13 Jan 2011 by Simon_Whale
import the excel data and run an outer join queryAccess Outer join query[^]
17 Jan 2011 by OriginalGriff
It depends. Normally, you would install SQL Server in one PC, and the others then connect to it over the network. The clients then need no extra installation unless they are editing teh database directly, rather than via your app.If you are using SQL server as a standalone database that...
9 Feb 2011 by Nish Nishant
See http://stackoverflow.com/questions/848872/select-n-random-rows-from-sql-server-table[^]
24 Feb 2011 by Espen Harlinn
CREATE TABLE Employee(Id bigint identity not null primary key,Name nvarchar(255) not null,Salary DECIMAL not null)goINSERT INTO Employee(Name,Salary) VALUES('Emp1',100001)goINSERT INTO Employee(Name,Salary) VALUES('Emp2',100002)goINSERT INTO Employee(Name,Salary)...
10 Mar 2011 by fjdiewornncalwe
For starters, don't try to mix up your logic. Separate what you want to do in your UI from what you want to do in your application logic. What I mean is that you should treat your "Yes" or "No" click logic and what happens on the form separately from the logic that you use to write information...
14 Mar 2011 by Manfred Rudolf Bihy
Of course you can have a table like that! Let's call the relation (table) "DirectAncestors" for example:Table DirectAncestors:PersonId bigint; (Foreign key to table Person.ID)FatherID bigint; (Foreign key to table Person.ID) MotherID bigint; (Foreign key to table Person.ID)The...
6 Apr 2011 by Sergey Alexandrovich Kryukov
You already got an overview of the criteria, see the Answer by Mika.Now, you have something to select from and perform comparison. See http://en.wikipedia.org/wiki/Comparison_of_relational_database_management_systems[^] and...
7 Apr 2011 by OriginalGriff
It isn't impossible to formulate such queries, but it is very difficult to design a user interface that allows non-technical people to construct them, without scaring off the idiots that will by any old tat on eBay average eBay user.Think about it: Google lets you do some of this, with...
22 Apr 2011 by Abhinav S
This could [^]help you get started.This[^] might also help.
15 May 2011 by Wonde Tadesse
It is not clear how and what framework you used to implement your application. But, if you are comfortable working with ADO Entity Framework[^] or NHibernate[^], such kind of query propagation is really easy. Just explore them.I hope this helps you well.
19 May 2011 by walterhevedeich
Put the columns that are not inside an aggregate function in the GROUP BY clause. Like this for example."select email,name,mobile,b.custrefno,SUM(b.paidamount) as paidamount from paym b,addcust a where b.custrefno=a.custrefno GROUP BY b.custrefno,email,name,mobile";
25 May 2011 by Not Active
Need to add more words because this won't except a simple, yes
8 Jun 2011 by OriginalGriff
Change comm = new OdbcCommand("select * from utilisateur where login=?", cn); comm.Parameters.Add("login", login.Text);To comm = new OdbcCommand("select * from utilisateur where login=@LI", cn); comm.Parameters.Add("@LI",...
8 Jun 2011 by Sandeep Mewara
Adding to other answer:" System.NullReferenceException: Object reference not set to an instance of an object."This simply means that you are trying to access a property of an object that is null. Using Visual Studio DEBUGGER will tell you exact line and the object that is null and thus...
1 Aug 2011 by Shameel
You have not mentioned what database it is. If it is SQL Server (as you have used SqlConnection class) then, as digimanus suggested, rewrite your query asSELECT TOP 1 * FROM [User]There is no LIMIT clause in MS SQL Server.If you database is indeed MySQL, then use the appropriate Library...
1 Aug 2011 by Wonde Tadesse
This probably happens due to LIMIT key word. If you are using SQL Server, it might not support the key word. Take a look at this Channel 9 discussion. SQL Server and LIMIT clauses on SELECT statements[^]
27 Aug 2011 by Shameel
Write a Stored Procedure that does your work and execute it at regular intervals using SQL Server Job[^].
2 Sep 2011 by Wendelius
This looks like a bad design. Instead of having years and values as separate columns, you should use a table with two columns:- Year- ValueSo the data in the table would be:Year Value---- -----2010 1552011 1192012 145With that, you would query for proper year always from...
2 Sep 2011 by Abhinav S
StepsStep 1) You need to host the database in central server / location and allow client programs to access it.Step 2) You will need to make sure all clients have network access to this location.Step 3) To do this, you will need to setup a database connection, say an ODBC setup, on every...
7 Jan 2012 by uspatel
if you want to create database using C#,see thisCreate a SQL Server Databaseuse ADO.net for database connectivityADO.Netotherwise sql server mgmt. studio is easiest way to create database and tables.see this http://www.sqlserver2005tutorial.com/
14 Jan 2012 by OriginalGriff
Try: using (SqlConnection con = new SqlConnection(strConnect)) { con.Open(); using (SqlCommand com = new SqlCommand("SELECT iD, description FROM myTable", con)) { using (SqlDataReader reader =...
12 Feb 2012 by Mycroft Holmes
Ah it is the automated issue that is the problem.I would use a SQL server job that runs periodically to check for expired data events and generate the email and send it via SQL mail and SMTP.Either that or use a timer in your c# app to do the same thing.You could also write a service...
15 Feb 2012 by Ed Nutting
Hi all,I have a Microsoft SQL Server database and I am using LINQ to SQL to interact with it in my ASP.Net C# 4.0 Website. What I would like to do is have a method that before a query is submitted to the database, grabs the command that will be sent and allows me to look at it. Basically, I...
18 Apr 2012 by Mohammad A Rahman
Hope it helps The Connection String Reference[^]:)
29 Apr 2012 by Espen Harlinn
One place to start is here: WCF Data Services[^]Then there is Introduction to ADO.NET Data Services/RIA Services[^] By Sacha Barber[Update]Try replacing localhost with (local)Data Source=(local)Best regardsEspen Harlinn
29 Apr 2012 by Sandeep Mewara
Generally, it is surface area configuration error or sql service configuration issue. Have a look at this thread for potential reasons and resolutions: Resolving A network-related or instance-specific error occurred while establishing a connection to SQL Server[^]If needed, See steps for...
7 May 2012 by OriginalGriff
Why are you using an SqlConnection to connect to an SDF file? Why not use an SqlCeConnection?SqlCeConnection connection = new SqlCeConnection();connection.ConnectionString = @"Data Source=D:\NewCode\DataBaseWin.sdf;Integrated Security=SSPI";connection.Open();
15 May 2012 by Mohamed Mitwalli
Hi , Check this using ( SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["testConnectionString"].ConnectionString)) { using(SqlCommand cmd = new SqlCommand("SELECT TABLE_NAME FROM...
24 May 2012 by Wendelius
Your code looks valid at a glance. When you call the ExecuteNonQuery, take the return value into a variable. So modify your code to...int rowsaffected = command1.ExecuteNonQuery();...Now using debugger, check what is the value of rowsaffected. It should be the total amount of rows.If...
24 May 2012 by Maciej Los
The command DELETE FROM Onlineis correct, but i prefer to use TRUNCATE[^] (see my comment to Mark Nischalke anser).In my opinion, the problem is in the below procedure: private void Form1_FormClosing(Object sender, FormClosingEventArgs e) { StopServer(); ...
15 Jul 2012 by OriginalGriff
As Wes says - it's pretty obvious! But please, please, don't do it that way! Do not concatenate strings to build a SQL command. It leaves you wide open to accidental or deliberate SQL Injection attack which can destroy your entire database. Use Parametrized queries instead: ...
16 Jul 2012 by Albert Holguin
For inventory control, I would definitely go towards an actual database. You said it yourself, it's going to get large fast, so relational databases are the best method of storing, recalling, and searching through large amounts of data. It might complicate things up front but it's definitely...