question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SqlTableDependency Recover Connection (Reconnecting)

See original GitHub issue

Hi,

I working on multi user software. The app communicate withe remote database, over internet.

When internet/connection is lost with the Server:

  • I need to be notified by an exception or an event. Please, how can I do that ?
  • I need to recover or reconnect the server. What is the best way ?

I tried to add event as flow:

` myTableDependency.OnError += (o, e) => { MessageBox.Show(e.Error.Message, “OnError”); };

myTableDependency.OnStatusChanged += (o, e) => { MessageBox.Show(e.Status.ToString(), “OnStatusChanged”); };

`

This code didn’t handle when database connection is lost. I tested that by stoping the database service.

Thanks for your awesome work.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
tomasfabiancommented, Nov 15, 2019

Hi Tomas. Could you help me with some example how to use this piece of code to check and reconnect if sqltabledependency has a failure ? Thanks

Hi @kmadar75, based on @christiandelbianco suggestion I published a nuget package “originaly” named SqlTableDependency.Extensions. Example is available here: https://github.com/tomasfabian/SqlTableDependency.Extensions

Let us know pls in case of any issue

1reaction
nadjibnetcommented, Sep 17, 2018

I have already subscribed to the error event as follow but it not handled it !

myTableDependency.OnError += (o, e) => { MessageBox.Show(e.Error.Message, "OnError"); };

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - SqlTableDependency reconnect in windows service
I am using SqlTableDependency https://tabledependency.codeplex.com/ in my .NET 4.5 windows service. The service is monitoring and working ...
Read more >
SqlTableDependency.Extensions 3.2.0
Provides reconnection extensions for SqlTableDependency and reactive data streaming of CUD operations from MS SQL Server.
Read more >
how to reconnect sql connection automatical if ...
Solution 1. The first thing you should investigate is why the connection is lost. If this is an acceptable and 'common' situation then...
Read more >
SignalR Core and SqlTableDependency - Part One
Another common problem with the re-connection is that the message-id could be bigger than the message itself, due to that the re-connection ......
Read more >
Reconnection failed. Try reloading the page if you're unable to ...
blazor server side auto reconnect In this tutorial we are going to update/redesign UI for showing " reconnection failed. try reloading the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found