Comments (14)
thank you for your cooperation
I also searched a lot and my issue solved by just small changing in connection string
<add name="DefaultConnection" connectionString="Data Source=serverName;Initial Catalog=KCMSDb;User Id = username ; Password = password;Integrated Security=True" providerName="System.Data.SqlClient" />
to
<add name="DefaultConnection" connectionString="Data Source=serverName;Initial Catalog=KCMSDb;User Id = username ; Password = password;" providerName="System.Data.SqlClient" />
or in simple by just removing "Integrated Security=True" from my connection string
from monitor-table-change-with-sqltabledependency.
Hi. Deployment is done using a backup database?
from monitor-table-change-with-sqltabledependency.
Backup database?
from monitor-table-change-with-sqltabledependency.
I created database in sql server in windows server, everything is running fine but not detecting any change
from monitor-table-change-with-sqltabledependency.
Ok. After runnig your application, can you see SqlTableDependency database objects? For example a new trigger on your database table?
from monitor-table-change-with-sqltabledependency.
Also, which sqlserver version are you usung?
from monitor-table-change-with-sqltabledependency.
private string ConnectionString { get { return System.Configuration.ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString; } }
private readonly static Lazy _instance = new Lazy(
() => new CommenHubService(GlobalHost.ConnectionManager.GetHubContext().Clients));
private static SqlTableDependency<CommentModel> _tableDependency;
public static CommenHubService Instance { get { try { return _instance.Value; } catch { return null; } } }
private IHubConnectionContext<dynamic> Clients { get; set; }
public CommenHubService(IHubConnectionContext<dynamic> clients)
{
Clients = clients;
var mapper = new ModelToTableMapper<CommentModel>();
mapper.AddMapping(e => e.ContentId, "ContentId");
mapper.AddMapping(e => e.CommentId, "CommentId");
mapper.AddMapping(e => e.Comment, "Comment");
_tableDependency = new SqlTableDependency<CommentModel>(ConnectionString, "Comments", mapper);
_tableDependency.OnChanged += SqlTableDependency_Changed;
_tableDependency.Start();
}
from monitor-table-change-with-sqltabledependency.
sql 2014 enterprise
from monitor-table-change-with-sqltabledependency.
ok...your code is fine.
When you run your application on local host, i suppose you are using a different DB.
In this case, can you try to change the connection string of your local application, pointing to deployed DB?
I ask that, because can be that DB you are using was created from a old SQL Server instance (for example 2008). Even if now it is under SQL 2014 enterprise, it conserve settings that make it not compatible with SqlTableDependency.
from monitor-table-change-with-sqltabledependency.
If you run this SQL script on DB (the one used by deployed on IIS 8 windows server)
SELECT DatabaseProperty('the database name', 'version')
GO
what is the result you get?
from monitor-table-change-with-sqltabledependency.
Also, can you run these two scripts?
SELECT name, compatibility_level from sys.databases WHERE name = 'the database name'
GO
SELECT name, version from master.dbo.sysdatabases where name = 'the database name'
GO
from monitor-table-change-with-sqltabledependency.
from monitor-table-change-with-sqltabledependency.
ok...last thing.
Can you make a backup of your database, removing all tables/stored procedures not involved in SqlTableDependency issue. Drop all record in monitored table. Then...can you send me?
Because i need as scenario to reproduce the issue you are facing. In all my tests I never had someting similar.
from monitor-table-change-with-sqltabledependency.
It seems to not work with Integrated Authentication
from monitor-table-change-with-sqltabledependency.
Related Issues (20)
- sqltabledependency trigger on my table “locks” all upcoming DML operations HOT 4
- Use DataTable or DataRow
- Permission error
- SqlTableDependency event trigger is not working if running as a BackgroundService HOT 1
- I cannot find a database table named "Table name"
- Nested object
- Returning dynamic Object / ExpandoObject
- Monitor multiple tables HOT 2
- Incorrect syntax near 'POISON_MESSAGE_HANDLING'
- The event object always returns null
- Design question - feasible to use in Azure DevOps and PowerShell script?
- OnChanged doesn't work after some time
- Text column type is not an supperted by SqlTableDependency
- Old stuff. Anyone maintaining this or new approach? HOT 7
- Detecting only Insert and update but not the Delete
- Is there a limit to the number of fields that can be declared in the C# class for trigger detecting?
- Keyword 'trust server certificate' not supported HOT 1
- Could not load file or assembly 'TableDependency.SqlClient, Version=8.5.8.0 HOT 1
- Delete command not working
- .net 8.0.100-rc.2.23502.2 error for SqlTableDependency HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from monitor-table-change-with-sqltabledependency.