Notification Support?
Notification Support?
On the website, it claims that it has database change notification support?
Can you give an example of how to set this up?
Can you give an example of how to set this up?
-
- Posts: 729
- Joined: Thu 13 Dec 2007 10:24
Well, the algorithm is actually very simple.
Here are your steps:
- rise a notification on the server side (see MySQL server documentation);
- choose in Visual Studio Forms designer your connection;
- look at Properties Window, click on the Events button;
- now you will see Error, InfoMessage and StateChange events;
- simply subscribe to the InfoMessage event;
Here are your steps:
- rise a notification on the server side (see MySQL server documentation);
- choose in Visual Studio Forms designer your connection;
- look at Properties Window, click on the Events button;
- now you will see Error, InfoMessage and StateChange events;
- simply subscribe to the InfoMessage event;
Documentation
Thats where I got confused, I've read that Mysql doesn't have notification messages. Apparenlty this is incorrect?
I see the event under the connection object (InfoMessage event), but could you please link me the mysql documentation that says how to setup server side events?
I see the event under the connection object (InfoMessage event), but could you please link me the mysql documentation that says how to setup server side events?
-
- Posts: 729
- Joined: Thu 13 Dec 2007 10:24
-
- Posts: 729
- Joined: Thu 13 Dec 2007 10:24
We use typed datasets with windows forms. There really isn't an easy way to refresh the data in the dataset when updates are made to the database. Easiest way to update the data is simply poll the database for the changes.Alexey.mdr wrote:What notification would you like to receive (please explain the logic)?
What kind of projects do you develop?
Probably we could find an alternative way to solve this problem.
I am guessing that this doesn't scale very well and is the reason while polling is the acceptable method?
-
- Posts: 729
- Joined: Thu 13 Dec 2007 10:24
I'm sorry, I've looked around for the documentation and haven't been able to find anything. I've also looked for the example, but haven't seem to come have found it.Alexey.mdr wrote:Probably you can use CoreLab.MySql.Web.MySqlCacheDependency class.
It represents a process that periodically polls the server and fires an event
if it detects changes in monitored tables.
Please refer to the documentation for the example.
Could you give me more information on where this example is?
I've been looking at the docs here:
http://www.crlab.com/mysqlnet/docs/
I see that this component is intended for web forms, does it work for winforms as well?
-
- Posts: 729
- Joined: Thu 13 Dec 2007 10:24
You can find help on MySqlDependency class in your local MyDirect .NET help.
It's faster to find it using Index search.
The example of MySqlDependency class usage you can find in
WinForms sample project here:
%Program Files%CoreLab\MyDirect.NET2\Samples\WinForms\
P.S. I have misspelled the class name in the previous post.
It's faster to find it using Index search.
The example of MySqlDependency class usage you can find in
WinForms sample project here:
%Program Files%CoreLab\MyDirect.NET2\Samples\WinForms\
P.S. I have misspelled the class name in the previous post.
Last edited by Alexey.mdr on Tue 10 Jun 2008 08:24, edited 1 time in total.
-
- Posts: 729
- Joined: Thu 13 Dec 2007 10:24
Looks good
This seems to work pretty well and is very easy to setup. So yes, I'd say this look like it'll work for polling the database. Thanks for putting my attention to this component.Alexey.mdr wrote:Waiting for your reply.
Hope the problem will be solved.
-
- Posts: 729
- Joined: Thu 13 Dec 2007 10:24