Click here to Skip to main content
15,894,405 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
I have database table called Tickets. Records are populated into the table by some third party application (So i don't have control over it). Ticket table has following columns
TicketNumber, Date, StartTime, EndTime.


Now I have written windows service in C#. I want to collect records from table when Date and StartTime will match using C#.

I don't want to write a query which will be executed after every 2 min, and will check for match record. I also tried to use Sql Dependancy but couldn't find the solution. I think I also can't write scheduled job because StartTime of the ticket is not same every time. It could be different for other days.

I want efficient solution which will need less number of times Database Connections or Query Execution.

Thanks,
bipin
Posted

Writing a SSIS package is the perfect solution for this. BTW, SSIS in Sql Server 2005 requires VB.Net, but that shouldn't be a problem - VB is the same as C#, only different.
 
Share this answer
 
Hi. You can try to use query notifications or database triggers. More info on http://stackoverflow.com/questions/1559581/how-to-notify-a-windows-servicec-of-a-db-table-changesql-2005[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900