Click here to Skip to main content
15,921,941 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hey there,

Does anybody of you can give me an advice howto make in VB.NET a quick way to make a function which handles with a lot of data from a MSSQL (datasets > 400.000)?
thanks.
Cheers
Arthur

[EDIT 1 Chill60]
Actually i dont display any data.
It is a analysis which write the result into a database


[EDIT 2 CHill60]
Hey! I meant datarows
I will go a little bit more in detail:

I have a database with cities and another database with hotels including a price linked to a city.
I am querying to get all hotels for all cities in a loop
I put the cities in an arraylist and the hotels as well.
Based on these data I have to do some math operations and fill a datatable with the results.

Unfortunatley it takes very long to run (> 3 hours)
Do you have any advice how to speed it up?
Posted
Updated 10-Apr-14 2:24am
v3
Comments
CHill60 10-Apr-14 7:33am    
Not clear. What do you mean by "handles" a lot of data - what is it doing with it? Why have multiple datasets? (Or do you mean DataRows???).
Member 9500954 10-Apr-14 8:28am    
Hey! I meant datarows
I will go a little bit more in detail:

I have a database with cities and another database with hotels including a price linked to a city.
I am querying to get all hotels for all cities in a loop
I put the cities in an arraylist and the hotels as well.
Based on these data I have to do some math operations and fill a datatable with the results.

Unfortunatley it takes very long to run (> 3 hours)
Do you have any advice how to speed it up?

-----
And i dont display any data.
It is a analysis which write the result into a database
CHill60 10-Apr-14 8:38am    
We must have been typing at the same time :-) Have you seen my 2nd comment?
CHill60 10-Apr-14 8:28am    
Ok ... just checking your terminology. So you have a "Database" with cities and another "Database" with hotels. Is there a particular reason why these are separate Databases and not just separate Tables within a single Database? That will greatly improve performance.
Secondly - is there a specific reason why you are bringing this data down into VB.NET - can you not perform the calculations in SQL - this will also greatly improve performance.
I would need to see your code to suggest any more improvements

No need to fetch all the records if you are displaying these records in a list (assuming). Just use paging and fetch the data according to the page size.

Hope it helps.
 
Share this answer
 
Hey!

Thanks for your msgs!!
yes of course I am using 2 tables in one database:)

I did what you suggested and put in a SQL string and the rest in VB.net.

Now, its working really fine and really fast :)

Thanks for your help

Cheers
 
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