Avatar of dave_sky
dave_skyFlag for United States of America asked on

Display error message when BindingNavigatorSaveItem is used with server off

In a windows application using visual studio 2005 and sql server 2005:

I need sample code to display an error message when the BindingNavigatorSaveItem is used with the server is off or disconnected.

I find that a user can press the BindingNavigatorSaveItem button and think the database is updated when the server is off or disconnected - when actually it is not updated.

Thanks!
Visual Basic.NET

Avatar of undefined
Last Comment
dave_sky

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
kaylanreilor

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
dave_sky

kaylanreilor,

Thanks for the response.

I have tried this code.

When I open the form, then stop the server and try to update -
I get the message ("Update successful") instead of ("Update failed").

I have done the 'Googleing' on this.

Any other ideas?



kaylanreilor

Why not testing the connection (kind of pinging the server) at the very beginning of this event handler.
This code was not supposed to be THE solution but the point where starting doing something.
ASKER
dave_sky

kaylanreilor,
Your first post answered the question - I had overlooked something very obvious.
Thanks!
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes