0

I'm working on a c# application. In this application there is master database and a slave database. Master database update data in slave database using transcriptional replication (I have implemented it and it is working fine).

My issue is that when master database update data of slave database, how my c# application will know that data is updated so refresh data in cache as well as on User Interface.

In another words how can i publish data from sql server to c# application.

2 Answers 2

1

Use SQL Dependency to achieve the auto notify in case of database update

See link

http://msdn.microsoft.com/en-us/library/62xk7953(v=vs.110).aspx

for the MSDN example

Note: The SQL dependancy works at table level, if you specify join in select statement then it might not possible to raise update event

While creating select query for SQL dependency, you can check & go through the MSDN link below `

http://msdn.microsoft.com/library/ms181122.aspx

`

0

Links that talk about this subject.

In summary, there are two proposed approaches. You have to be clear about your requirements to have a wise decision as different alternatives have different pros and cons and some could be an overkill.

First approach is to have an timer that triggers a data refresh to your ASP.NET control that is nested in an UpdatePanel. Here.

Second approach is by utilizing Cache Dependency. Here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.