0

I am developing one chart application on .net framework by using Silverlight and Visifire, Its a silverlight application and I am running it on localhost. I have connected through SQL server database to my application and it is running fine, The main thing that i am looking for is that, when i change data inside the database, It should dynamically change my application's chart values.

What I tried is, I set the page refreshing parameter in my web page and its updating the values also, but whole application is re-appearing.

So, Is there any way to change the chart value parallely as I change my values in database.

Looking forward for response,

Thanks.

Ars
  • 59
  • 1
  • 8
  • You can create a timer in your silverlight control that polls the database every x min's but this will make alot of calls to the db. – TBohnen.jnr May 19 '11 at 07:56

1 Answers1

0

You can use "DispatcherTimer" in Silverlight application and call UpdateChart() on each tick event of the timer. Checkout the sample code below.

public Page()
{
    System.Windows.Threading.DispatcherTimer timer = new DispatcherTimer();
    timer.Interval = new TimeSpan(0, 0, 10); // 10 sec
    timer.Tick += new EventHandler(timer_Tick);
    timer.Start();
}

void timer_Tick(object sender, EventArgs e)
{
    UpdateChart();
}

Hope this helps!

Somnath
  • 3,247
  • 4
  • 28
  • 42