IsNemoEqualTrue / monitor-table-change-with-sqltabledependency

Get SQL Server notification on record table change
MIT License
655 stars 177 forks source link

Text column type is not an supperted by SqlTableDependency #243

Open IichiKohuro opened 2 years ago

IichiKohuro commented 2 years ago

My class:

public class ServiceIngenerJournal
{
    public int ID { get; set; }

    public bool state { get; set; }

    public DateTime? dt { get; set; }

    public int? numobject { get; set; }

    public string dopinfo { get; set; }

    public int? statecell { get; set; }

    public string nameaddress { get; set; }

    public string prefix { get; set; }

    public string comments { get; set; }

    public bool? isSirenOn { get; set; }
}

Main code:

SqlTableDependency<ServiceIngenerJournal> dep;
private static List<ServiceIngenerJournal> entities;

private void Start()
{
    try
    {
        dep = new SqlTableDependency<ServiceIngenerJournal>(journalsDbConnString, "ServiceIngenerJournal");     
        dep.OnChanged += Changed;

        dep.Start();            
    }
    catch (Exception ex)
    {
        // throw here
        Console.WriteLine(ex.Message); 
    }
}