Click here to Skip to main content
15,885,821 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
So I have an SQL server connected to a C# Windows Form, the C# code extracts data from the database table perfectly fine

What I want to add is a method that allowws me to start with an EMPTY table and then keep checking it until a row has been inserted in it, but I caan't seem to figure out how

Anyone has any ideas?
Posted
Comments
Karthik_Mahalingam 25-Jan-14 15:44pm    
Can u pls add more information..
what you have tried ??
Shambhoo kumar 25-Jan-14 23:55pm    
declare a int type variable in code side and write execute command like this

int result=cmd.ExecutenonQuery;

if(result>0)
{
//inserted
}
else
{
//not inserted.
}

Try and go through SQL Serer notification services - http://technet.microsoft.com/en-us/library/ms172483%28v=sql.90%29.aspx[^].
 
Share this answer
 
v2
Comments
Ron Beyer 25-Jan-14 22:44pm    
+5, notifications are good for smaller systems but they don't scale well. I've been trying to find the point at which they become less effective. Nobody says at what scale they deteriorate they just say its not for "larger" scale systems.
Abhinav S 25-Jan-14 23:06pm    
Thank you.
You probably want to use SQL Server CLR integration. See this[^] link.

/ravi
 
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