Hi, I posted a similar post to this before but since then i have done some research and thought i'd put this one out again to see if anyone maybe has any thoughts on my problem.
I am running a WPF application with C# as the code beind. The datbase i am using is SQL Server 2005.
Now i am currently binding to the database using ADO.Net and retrieving the data from the stored procs in the db. This is then stored in datasets and further down the line bound to controls in my WPF application.
Now the data that i am binding to in the db is constantly changing, let say every few seconds. What i want is a mechanism to automatically tell me in C# when the data that i have bound to in the db, so the data returned from my stored procs has changed.
I looked on the web and found notification services and SQLDependency class but this is being deprecated. I also saw CLINQ but this doesn't seem to handle the database notification side, it only works for collections in c# from what i understand.
I mean the plan B method is to just have a thread in my C# code to poll the same stored proc every few seconds based on a timestamp that is stored on every row in the returned dataset. If my current timestamp is greater then what is being returned then retreive that data. This would then run in this new thread looping over and over. An if any data was returned from the connection in the thread that would mean that data has changed and so store that data into my collections in c# so they can be bound to my WPF app.
Obviously this is something i don't really want to do as i thought there maybe a smarter way to do this but i just can't seem to located anythings.
Does anyone have any ideas on this one?
Much appreciated Iffy.