Click here to Skip to main content
15,885,537 members
Articles / Desktop Programming / WPF

AutoRefresh Entity Framework Data Using SQL Server Service Broker

Rate me:
Please Sign up or sign in to vote.
4.77/5 (35 votes)
14 Sep 2012CPOL3 min read 167.4K   3.8K   95  
How to use SqlDependency to refresh Entity Framework Object Sets automatically on DB changes
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<h1>
	Readme for MyChat</h1>
<p>
	MyChat is a simple WPF application that demonstrates the usage of the AutoRefreshWrapper
	outlined in <a href="http://www.codeproject.com/Articles/233770/AutoRefresh-Entity-Framework-data-using-SQL-Server">
		http://www.codeproject.com/Articles/233770/AutoRefresh-Entity-Framework-data-using-SQL-Server</a>.</p>
<p>
	The program can be started several times on one or different computers. In each 
	instance the user can enter a name and a message and then press the &quot;Send&quot; 
	button. The message will be sent to the database and each instance will be 
	notified about the change and will update the list of messages immediately.</p>
<p>
	Note that you might need to change the database connection by editing the 
	application config (MyChat.exe.config). The default is &quot;.\SQLEXPRESS&quot;.</p>
<p>
	In order to create the database you may open &quot;Model\Model1.edmx&quot; in Visual 
	Studio, right-click and select &quot;Generate Database from Model&quot;. Make sure that 
	your database server is configured to work with Service Broker and that you&#39;re 
	using sufficient credentials for login.</p>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

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


Written By
Germany Germany
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions