0

I've been desperately trying to find a way to notify the client of changes in the database.

I tried TableDependency Package but then noticed that that uses SQL and not MYSQL. I stumbled upon Devart and they have the same thing. I've installed the package and set up some code to test if it actually receives notification when there is a change in the database. But when I try to run it returns me the exception:

Devart.Common.LicenseException: 'Feature is not supported.

Here's the code i use for testing:

namespace WpfApp2
{

    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public string connectionString = @"server=198.23.60.117;user=*******;database=*******;password=*******";
        public MainWindow()
        {

            InitializeComponent();
        }


        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Devart.Data.MySql.MySqlConnection DependencyConn = new Devart.Data.MySql.MySqlConnection(connectionString);
            Devart.Data.MySql.MySqlCommand FriendsDependencyCommand = new Devart.Data.MySql.MySqlCommand("SELECT user_two FROM friends WHERE user_one=@username", DependencyConn);
            MySqlDependency dependency = new MySqlDependency(FriendsDependencyCommand, 100);
            dependency.OnChange += new OnChangeEventHandler(dependency_OnChange);
            DependencyConn.Open();
            MySqlDependency.Start(connectionString);
        }

        void dependency_OnChange(object sender, Devart.Data.MySql.MySqlTableChangeEventArgs e)
        {
            MessageBox.Show("Database Changes Detected.");
        }
    }
    public class Customer
    {
        public string Username { get; set; }
    }

}

I should have the needed Dependency's I installed the package using the NuGet Package Manager.

Here's the documentation

Any clues? I'd really appreciate.

FaizanHussainRabbani
  • 3,256
  • 3
  • 26
  • 46
Ruben Versavel
  • 161
  • 2
  • 12

1 Answers1

2

Current implementation of dotConnect for MySQL includes two versions of assemblies:

1) the .NET Framework Devart.* assemblies which are shipped with installation:

    * assemblies are created at C:\Program Files (x86)\Devart\dotConnect/MySQL\ (by default)
    * licensing approach is described at https://www.devart.com/dotconnect/mysql/docs/?Licensing.html

2) the .NET Standard (.NET Core) Devart.* assemblies which are available via NuGet:

    * you can download packages from https://www.nuget.org/packages/devart.data.mysql
    * licensing approach is described at https://www.devart.com/dotconnect/mysql/docs/?LicensingStandard.html

The "Devart.Common.LicenseException: 'Feature is not supported.'" error means that runtime cannot find the license file (or License Key connection string parameter) for the .NET Standard Devart.* assemblies. Refer to https://www.devart.com/dotconnect/mysql/docs/?LicensingStandard.html.

Devart
  • 119,203
  • 23
  • 166
  • 186