|
-
Sep 22nd, 2005, 07:03 AM
#1
Thread Starter
Fanatic Member
Listen to database for new insert??????
does anyone know how to refresh page
on my webform is a datagrid which reads messages from a database
when a new message comes in it is saved to the database
but for me to see a new message in my datagrid i have to press refresh,
i want this page to be as live as possible,
i.e. refresh constantly
any ideas much appreciated
Last edited by d2005; Sep 23rd, 2005 at 04:45 AM.
it works 60% of the time, all the time.
-
Sep 22nd, 2005, 08:15 AM
#2
Thread Starter
Fanatic Member
Re: refresh page
i got the page to refresh but i dont think its what i need
alls i hear is kk kk kk kk every time its refreshed
besides my datagrid will have controls on it
how can i update my datagrid when a new msg comes into databse
it works 60% of the time, all the time.
-
Sep 22nd, 2005, 08:56 AM
#3
Re: refresh page
alls i hear is kk kk kk kk every time its refreshed
This is the most paranormal programming problem I have ever come across.
-
Sep 22nd, 2005, 09:14 AM
#4
Addicted Member
Re: refresh page
 Originally Posted by mendhak
This is the most paranormal programming problem I have ever come across. 
it's a known issue, should be MN MN MN MN - taken care of in the next service pack i believe
-
Sep 22nd, 2005, 10:47 AM
#5
TPM
Add yourself to the VBForums Frappr Map!!
-
Sep 22nd, 2005, 02:48 PM
#6
Re: refresh page
You could try to use an html meta tag,
<META HTTP-EQUIV="refresh" content="1;URL=http://www.vbforums.com">
This refreshes a page every second. You have to change the 1 for the ammount of seconds you want the page to stay still before it refreshes.
HTH
-
Sep 23rd, 2005, 04:44 AM
#7
Thread Starter
Fanatic Member
Re: refresh page
lol, KK KK KK KK is the wee noise that IE makes when it refreshes
i put in web config file to refresh the page every second and the on noise would drive you insane
MY PROBLEM
basically i have sms messages coming into database
i set up a datagrid to read from database the messages that are sent in
but i need this datagrid ( or however im going to display this information) to update when a new message comes into database.......
but this display will also have a reply button which shall write to the database and send out.
therefore i dont think i can refresh the whole page this way.
does any one know how to keep a table or datagrid 'live' where as it recognises a new message has come in and therefore will populate my display information accordingly
it works 60% of the time, all the time.
-
Sep 23rd, 2005, 05:27 AM
#8
Addicted Member
Re: Listen to database for new insert??????
nah, i cant see how you can easily keep your grid 'real time' . the web is stateless in that the your client (browser) is uaware of the server - you could force the page autorefresh every n-minutes as HoraShadow suggests and redisplay the contents of your database table in the grid - resource heavy and no doubt a frustrating experience for any user (page refreshing).
personally i would reconsider the design - use a 'check for mew messages' button and/or maybe use email or sms to send notifications of new messages
-
Sep 23rd, 2005, 06:13 AM
#9
Re: Listen to database for new insert??????
You could split the page into two sections:
a) The whole page without the datagrid. It would have where you type your messages and all the other info, that doesn't have to reload so you don't lose what you are typing.
b) An iframe with the datagrid inside, with the command to refresh every xx seconds.
That way the only thing that refreshes is the iframe, the rest of the page remains static.
But to keep it 'live' just when you have a message, I don't know how you could do that with plain .NET, unless you use something else, like flash to do that.
The Microsoft's Web messenger does this tough, so it can be done and look really good. You can check it out at http://webmessenger.msn.com/
-
Sep 23rd, 2005, 06:15 AM
#10
Thread Starter
Fanatic Member
Re: Listen to database for new insert??????
is there a way to send like a popup etc... to notify the user of a new incoming message, then they can refresh it manually if you get where im coming from
its basically like a messenging service but the messages are saved to database first
it works 60% of the time, all the time.
-
Sep 23rd, 2005, 07:44 AM
#11
Addicted Member
Re: Listen to database for new insert??????
lots of ways - i'm sure there are 3rd party messenger apps, SQL Notification Services or even a plain old trigger on your database table that runs a NET SEND command when a record is inserted. but these would all have to be external to your web app and would require seperate development
-
Sep 23rd, 2005, 08:01 AM
#12
Thread Starter
Fanatic Member
Re: Listen to database for new insert??????
yes powdir this seems to be the way to do it,
the thing is you see is that the application that recieves the sms and gets them into database is an external application,
my web app only needs to read from the database
but i need the reading of a new insert to be done immediately more or less,
could you please expand on the notification services or net send
any tutorials etc......
it works 60% of the time, all the time.
-
Sep 23rd, 2005, 08:17 AM
#13
Addicted Member
Re: Listen to database for new insert??????
i fully understand what your trying to do
having the web page force a refresh when there might not be new records present is inefficient and clumsy. I've never looked at the webmessenger stuff HoraShadow mentions so i cant comment
NET SEND is old hat but if your users are all on the same network it might be a cheap workaround, google that and "SQL Notification Services" for the requirements/tutorials. Bottom line - if your web app can access the db tables then so can a helper app that fires some sort of notification event when a record is inserted. like i said consider moving the WHOLE notification mechanism out of the web app.
-
Sep 23rd, 2005, 09:14 AM
#14
Thread Starter
Fanatic Member
Re: Listen to database for new insert??????
yeah i think the net send maybe the stuff, as sql notification seems to be a download
is there anyone with experience of net send
could anyone take me through the steps involved
i.e. set up new column in database
write this procedure etc...
im looking to notify a user on a web app that a new entry is made to a database
im a net send first timer
it works 60% of the time, all the time.
-
Sep 23rd, 2005, 09:35 AM
#15
Addicted Member
Re: Listen to database for new insert??????
NET SEND is an network admin tool - it's NOT a elegant solution, more a simple workaround hack. but if you must (and the network allows for it)
1) create a subscribers table - this will hold the names and network addresses of those interested in receiving notifications (subscribers)
2) create a trigger on the existing messages table that fires on an insert, within the trigger use a cursor to loop through the subscribers table.
3) for each record in subscribers execute a xp_cmdshell 'NET SEND' on the network address field. continue to loop through the subscribers table until all the entries have been notified.
I only use this for debugging.
..it also makes for a nice wind up.
-
Sep 23rd, 2005, 10:07 AM
#16
Thread Starter
Fanatic Member
Re: Listen to database for new insert??????
thanks powdir
im gonna give this a go first because basically i need to show something working by mid next week,
then i can let it run and go into more depth in the application and continue development
one thing i just want to make sure,
this net send will be on a web app, so therefore it shall be on the internet,
does this possible solution apply to the internet,
all your help has been much appreicated and has given me ideas of how to resolve my problems ( as first i was starting off to refresh page)
it works 60% of the time, all the time.
-
Sep 23rd, 2005, 10:15 AM
#17
Addicted Member
Re: Listen to database for new insert??????
no NET SEND only works on a local network (i mentioned this earlier!) - i can't offer a step-by-step solution here, only suggestions and my biggest one is to remove the notification mecahnism from your web app. use NET SEND only on toy apps, for debugging or as a proof of concept
good luck
-
Sep 23rd, 2005, 10:21 AM
#18
Thread Starter
Fanatic Member
Re: Listen to database for new insert??????
lol
im gonna need all the luck in the world
thanks
it works 60% of the time, all the time.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|