-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: SitaramanM
Message 4 in Discussion

 Hi   As pooran suggested web services can be used.  But web services by itself is not 
enough for your requirement and neither is it the only option.  there is much more to 
it here than what meets the eye.     Your requirement is that there will be certain 
events that will be happening at the server level and whenever these events(lets say 
data change like stock prices falling) then the client application needs to be 
notified bout the same. Right!!!!!   One option is polling the server database.  This 
is a old and dumb technique and not for professional applications. Two features of 
.Net that allow you to the achieve the functionality that u desire are :  a) Events, 
Delegates and Callbacks   b) Remoting  You need to use a mix of these two features to 
create the ap tht u want. MSDN offers extensive material for these topics.  In fact 
there is a example in MSDN which combines the Remoting and Events,Delegates and 
CallBacks to create a simple chat application(The original example had a bug and MS 
has posted the updated code at 
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q312/1/14.asp&NoWebContent=1).
   The following is the programming approach tht i would suggest    Server-Application 
 a) Your business application will be running on the server(in ur case i guess the asp 
application) b) Create a Remoting Server application(preferrably Singleton) c) Define 
public Events in the Remoting Server Aplications  d) Expose events from the Remoting 
Server Application e) Declare some public functions in Remoting Server Application. 
which will raise the event f) When the data is changed thru the business application,  
perform the data changes(more on this later in the Note below) g) After the data is 
Changed Notify the Remoting Server Application thru normal function calls exposed by 
the Remoting Server App h) From the Called Remoting Server App Functions, Raise the 
events from Remoting Server Application passing the Changed Data as parameter(wish i 
could raise events of the Remoting Server App from th business function itself.  but i 
dont think it is possible.  In fact if i am right u cannot even raise an event of a 
parent class from the c hild class.  if it is not possible from a child class then i 
dont think it will be possible from a object instance) i) Return to the calling 
function    Client-Application  a) Create a VB Appplication that runs on th systray b) 
Make this a Remoting Client Application c) Create the Remoting configuration file(can 
do it thru code also, but suggest config file here) to connect to the Remoting Server 
App defined in step b) of the Server -Application that you have created d) Subscribe 
to the events by writing Event Handler Function e) In the Event Handler functions 
write code to display the data   Note : In this case you need to call into the 
Remoting Server application every time a data is changed.  You can centralise this 
functionality somewhere else for ease of development.  If the changes are database 
specific, then instead of calling the RemotingServer APP functions in every business 
function after data change ,  you can probably use triggers in the tables which call 
extended stored procedures, which i believe can be written in .Net.  This is a gray 
area for me, as DB has never been my forte, but you can check out Gaurav's source code 
example in http://www.wintoolzone.com/processor.aspx?ID=90 which talks about "how to 
use managed code from SQL Server 2000 extended stored procedures."  and i believe this 
should help u out.  This is also one of the options available to you.  However as a 
rough start you can skip this and call the Remoting Server App functions from the 
business functions directly and later enhance it   So look up the msdn for the article 
and sample i mentioned above and then prototype a sample based on the steps mentioned 
above.  In case of any issues do post ur queries.  I had fooled around with such an 
application(A bank application which sends notifications to customers when there is a 
transaction in  their account) but dont seem to have it with me here.  Will try to 
post the sample if i get hold of it...   hth   regards,   sr

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to