Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with SQLDependency!

Status
Not open for further replies.

Antzz

Programmer
Jan 17, 2001
298
US
Hi Guys,
Not sure if I should put this in the C# forum. Was looking for ADO.Net or .Net2.0 but could not find any.

Anyways, here is my problem:
Desired Effect:
I have a database table with some data and a win-client app which uses SQLDependency to subscribe to changes in the database. Ideally, changes should be reflected with out any issue as soon as data in the database is updated/inserted/deleted

My effect
* When I start the app and subscribe to it, the DataChanged event is triggered off by the database even though no changes have taken place at this time(during load). When I looked at the SQLDependency information in more detail, it says that the error is because of an "Invalid statement" and the it is happening during the subscription itself. I have followed all the conventions of structuring the SQL statement and have not been able to locate the issue as yet.

Any help will, as always, be appreciated.

A
 
Are you using the two part table reference (i.e. dbo.TableName) ?

If so, can you post your SQL statement or code ?
 
Thanks Shelton.

I found what the problem was. I was using a Date in my where clause. It seems like the query works only if you explicitly convert the date into a SQL date using the CONVERT function in your TSQL which you are passing from the client.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top