Click here to Skip to main content
15,889,854 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi which one is more efficient in a windows form(as a fix table):
- 2 dimensional array[600,600]
- using excel datasheet as a dataBase
- SQL server DBMS
Posted
Updated 15-Aug-11 4:11am
v2

First question is, what do you mean with efficiency, speed of retrieving data, looping data, amount of used memory, coding speed and reliability...?

If you mean access speed in your program, an array would most likely be the fastest from these, but where does the data come from? Also if you need data persistence, how do you store the data. If you use custom in-memory structures you most likely have to build a lot of supporting operations (read, save etc) to fulfill the requirements.

Excel doesn't qualify as a database and I wouldn't use it as a data store. Also as Simon stated the interop can be a mess.

SQL Server is a database, it offers data persistence, transactionality etc, but retrieving and modifying data is typically slower than with in-memory data structures. However, it offers a wide variety of operations for data handling out-of-the-box so coding would be easier compared to custom solutions.

So without more background information it's hard to put these in order.

One option you didn't mention is a datatable. As you can use a datatable for storing the data and it also has WriteXml and ReadXml methods it could be one possibility if the data amounts are small and reading and writing to disk are seldom operations.
 
Share this answer
 
Comments
shiny1366 16-Aug-11 21:58pm    
Thank Mika!
I just want to read data. If I use array[600,600] in my program,the speed of retrieving data will be good or not?
basically using a 2 dimensional array in a large size isn't bad or it depends?
Wendelius 17-Aug-11 11:55am    
How do you populate the array? Are you reading the data into the array from someplace?

Having a large array may reduce the performance so one option is to use HashSet[^] instead (depending how you use the data).

One downside with these is that they consume memory so if your program constantly keeps lots of data in memory it may reduce the performance. If a database is used, it provides a caching mechanism so the memory impact may not be as big as with in memory structures, but again, this depends greately on the situation.
shiny1366 17-Aug-11 13:36pm    
I want to use the array to implement Floyd-Warshall algorithm so should I use HashSet or other things?& I just want to read data from the array.
best regards.
Wendelius 17-Aug-11 17:05pm    
Ok, so you're probably just having loop iterations. In that case I think array would be fine.
shiny1366 17-Aug-11 22:28pm    
thank u!
Excel interop is far from stable, if you can avoid using excel interop you should, save yourself some headache.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900