Question

I created a wpf browser application ,and I hosted it in a live server ,it is a Inventory Management application ,which uses database heavily for saving, updating and selecting data.On save and select operation it takes very long time to save and fetch data to and from database.In the meantime (when save or select data from database) the application is irresponsive .How to make the application fast when dealing with database and how to make the application responsive during that operation .I am totally messed up ,its very kind if anyone has the answer . Is using stored procedures instead of raw sql bring performance or not?

Edit

My application interact with database by using raw sql statements.

Was it helpful?

Solution

Responsive Application

In order to make your application responsive you need to make every interaction with the database in a new thread or task. You could also use the new C# 5.0 features await and async.

Your current application is blocking because the main thread is handling database operations as well as user interface, so what you need to do is to handle these two separate functionalities in separate threads.

Fast Database Access

I don't know how are you dealing with the database right now, but you could definitely use some kind of ORM like Entity Framework or NHibernate. For better performance, but much less readable and mantainable code, which is really important, you could use raw sql.

OTHER TIPS

try this

to access DB faster in .NEt i am sure it not problem with c# but for querying and retireving DB u need to have better mechanism

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top