Click here to Skip to main content
15,920,603 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am pretty new to asp.net. I have a mysql database which am storing total records that i extracted from a particular site.My requirement is like whenever a new record is addded to DB my application should show the realtime change of records.

For eg
if i have a lable in my application like totalrecords=somevalue that somevalue should change according to number of newly added records.Can anyone pls tell how i can acheive this.


thanks
Posted
Updated 23-Sep-14 0:25am
v2
Comments
Sergey Alexandrovich Kryukov 23-Sep-14 14:36pm    
There is no real-time functionality on the Web. You certainly mean something else.
—SA

There are multiple approaches for this. You can do this on yourself, as you know when the user will update the content, or you can either let the server handle this and send the data to the client.

You can use the ASP.NET technology to send the requests and call for data from the server using the WebSockets. ASP.NET SignalR is a technology that provides the functionality of "Real Time" applications.

You can use this in your ASP.NET application, and learn how to implement it from the ASP.NET website. http://www.asp.net/signalr[^] They have a great document for this technology.

SignalR lets your server to communicate with the clients. You can send the data whenever you want to the server, and then use the SignalR technology to push (as Sergey has also mentioned, push and pull technology) the data to the client. This data will be captured and rendered into the HTML using JavaScript and so on.

This is a broad topic, so it will be good to learn the SignalR from the ASP.NET website. They're having great tutorials and a great forum for you to discuss the things about it.
 
Share this answer
 
Please see my comment to the question. The question is not really clear, but it's possible that everything boils down to a very serious problem of push technology vs pull technology.

For some background, please see my past answer: Application 'dashboard' for website accounts[^].

—SA
 
Share this answer
 
Well, it won't be real-time, since that is something else. As SA stated, there is no real-time on the web. There is no real-time if not all components of the system - including all OS and network fulfill some criterias.
But, you can achieve what you described. As SA stated, there are two approaches to send information to an other party: push and pull. Web is "pull" by default - since http is stateless. Still, there were interesting initiatives to implement push approach even before html5 - to have http connections kept open (see: http://en.wikipedia.org/wiki/Comet_(programming)[^], Gmail used to use such an approach). With html5, you have WebSockets.
And if for some reason none of these work, you still have the plain old scheduled ajay query.
Well as there can be many parties between the client and the server, you have to take into account a considerable latency in any case. So it won't be real-time.

Still, if you want to feel alike, you can have it. And if you don't want to code yourself all alternatives, here you have the tool you can use for sure: http://signalr.net/[^]
 
Share this answer
 
v4

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