Link to home
Start Free TrialLog in
Avatar of David Svedarsky
David SvedarskyFlag 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!
ASKER CERTIFIED SOLUTION
Avatar of kaylanreilor
kaylanreilor
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of David Svedarsky

ASKER

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?



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.
kaylanreilor,
Your first post answered the question - I had overlooked something very obvious.
Thanks!