Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

Vb.net Problem Help Kailangan na po :(

asdfghmak

Novice
Advanced Member
Messages
33
Reaction score
0
Points
26
System po kase namin is Hotel Room Monitoring, e kailangan nakanetwork yung mga receptionist at admin na module, pano po yung mag aauto refresh kada may gagalawin sa database?
 
System po kase namin is Hotel Room Monitoring, e kailangan nakanetwork yung mga receptionist at admin na module, pano po yung mag aauto refresh kada may gagalawin sa database?



---
pasok mo sa function, tas call mo sya sa dulo every action taken ng users. :approve:
 
System po kase namin is Hotel Room Monitoring, e kailangan nakanetwork yung mga receptionist at admin na module, pano po yung mag aauto refresh kada may gagalawin sa database?

---
pasok mo sa function, tas call mo sya sa dulo every action taken ng users. :approve:

or gawan mo ng timer na nag ca-call ng data every 2secs, parang nag rerefresh sya every 2secs :lol:
 
@ts pag aralan mo paano ginagawa yung chat application, parang gnyan yung pattern nun, kung sa .NET parang gagawa ka ng event sa server na na-trigger pag na modify yung database, then naka subscribe sa event yung mga clients mo bale may event handlers na nag respond to this specific event, parang callback kumbaga. meaning, si server ang mag signal sa clients na nag update sya so kelangan din nila lahat mag update
 
Socket Programming client-Server, or puede kang gumamit ng FileSystemwatcher every event mo sa database mag log ka either text file and then i filter ng mga clients or ng server yung log for Last write dun puede kang gumawa ng event to refresh your dataset. pero masyadong complex kasi yung path dun sa log file eh i aacess din ng ibang clients.
 
Last edited:
System po kase namin is Hotel Room Monitoring, e kailangan nakanetwork yung mga receptionist at admin na module, pano po yung mag aauto refresh kada may gagalawin sa database?

post mo nga dito yung buong code ng page mo na gusto mong mag refresh :)
 
---
pasok mo sa function, tas call mo sya sa dulo every action taken ng users. :approve:
Tinry ko na po ilagay yung function sa timer kaso ang problema nagbibilink yung controls kaya ang pangit po tignan sabi ng prof namen

- - - Updated - - -

@ts pag aralan mo paano ginagawa yung chat application, parang gnyan yung pattern nun, kung sa .NET parang gagawa ka ng event sa server na na-trigger pag na modify yung database, then naka subscribe sa event yung mga clients mo bale may event handlers na nag respond to this specific event, parang callback kumbaga. meaning, si server ang mag signal sa clients na nag update sya so kelangan din nila lahat mag update
Sige sir try ko muna mag search about dyan. Tanong nalang po ulet ako pag may di ako naintindihan

- - - Updated - - -

post mo nga dito yung buong code ng page mo na gusto mong mag refresh :)

lahat siguro ng select statement ng system sit

- - - Updated - - -

Socket Programming client-Server, or puede kang gumamit ng FileSystemwatcher every event mo sa database mag log ka either text file and then i filter ng mga clients or ng server yung log for Last write dun puede kang gumawa ng event to refresh your dataset. pero masyadong complex kasi yung path dun sa log file eh i aacess din ng ibang clients.

Thankyou sir try ko magsearch about dyan
 
Best way is gawa ka ng fuction gaya ng suggestion sir rockmode saakin nun. wag ka sa timer.
 
Best way is gawa ka ng fuction gaya ng suggestion sir rockmode saakin nun. wag ka sa timer.

tama, lakas kumaen sa process nan, tas may tendency den na bumagal ung app kung ganun lalo na kung malakihan na ung system tas madami ng records.
 
If you want a robust solution use a Message Queuing framework. Since you are using VB.net, Windows has a built-in service called Microsoft Message Queuing (MSMQ) which you just need to activate through Control Panel->Programs and Features->Turn Windows features on or off. Once activated you can start writing code to send and receive messages to and from other clients (receptionist computers in your case).

The concept is very similar to what soapboy mentioned except that the clients doesn't have to be online all the time. Messaging Queue's architecture allow all messages to be sent and received by all clients subscribed to it. For instance, if one of the clients reboot or crashed while another is sending an update to the database, that offline client will still be able to retrieve the last message when it connects back to the messaging server.

What would be on each message sent by a client? They can be anything. In your case, it can be an SQL statement or it can be a 4-tuple string separated by a comma (eg. UPDATE,tableName,columnName,value).

A message is sent by a client to a server process you create-- one that handles all the database transactions. When a message is sent, it is first handled by that server where the message is converted into an SQL query. If the query is successful, the message is saved to the MSMQ server. You can then have your server notify the subscribed clients after the message has been saved so that they can retrieve the message from the message inbox, or you can have the client poll the MSMQ server to check if there are new messages-- it's up to you.

You can visualize the architecture like this.

Client1---(Send)---->Server<--(Send)---Client2
Client3---(Send)------/ || \--------(Send)---Client4
...|................................||...............................|
...|.(Receive)................/..\...............................| (Receive)
...|............................./.....\..............................|
...|................DB Server.........MSMQ Server.......|
...\----------------------------------/ \--------------/
 
Last edited:
Panong function sir? newbie lang kase e

Call mo ulit ung public sub or function na ginawa mo for displaying records in data grid view. saka lng mag uupdate ung list ng record sa dgv if may na change na record or may naidagdag. di tulad ng timer na refresh ng refresh kaht walang pumapasok or changes na nangyari
 
Call mo ulit ung public sub or function na ginawa mo for displaying records in data grid view. saka lng mag uupdate ung list ng record sa dgv if may na change na record or may naidagdag. di tulad ng timer na refresh ng refresh kaht walang pumapasok or changes na nangyari

San po ilalagay yang function nayan sir? Listview po gamit ko
 
@nox101

paano nya malalaman na may nagupdate or nag dagdag sa db? need ko to for future.
 
Last edited:
gawa ka ng server side na service

client1 -> server -> update mass client from client1

client1 to server (save)
server to many clients (send to many what client1 save)

pag-usapin mo yung system na nagawa nyo na client to server to client
 
gawa ka ng server side na service

client1 -> server -> update mass client from client1

client1 to server (save)
server to many clients (send to many what client1 save)

pag-usapin mo yung system na nagawa nyo na client to server to client

Pano sir? di ko magets
 
gawa ka ng server side na service

client1 -> server -> update mass client from client1

client1 to server (save)
server to many clients (send to many what client1 save)

pag-usapin mo yung system na nagawa nyo na client to server to client

Ito ung sagot. lagay nyo code nyo para mas madali
 
Ito ung sagot. lagay nyo code nyo para mas madali

lahat ng select statement ng system sir dapat parang nag aauto refresh

- - - Updated - - -

If you want a robust solution use a Message Queuing framework. Since you are using VB.net, Windows has a built-in service called Microsoft Message Queuing (MSMQ) which you just need to activate through Control Panel->Programs and Features->Turn Windows features on or off. Once activated you can start writing code to send and receive messages to and from other clients (receptionist computers in your case).

The concept is very similar to what soapboy mentioned except that the clients doesn't have to be online all the time. Messaging Queue's architecture allow all messages to be sent and received by all clients subscribed to it. For instance, if one of the clients reboot or crashed while another is sending an update to the database, that offline client will still be able to retrieve the last message when it connects back to the messaging server.

What would be on each message sent by a client? They can be anything. In your case, it can be an SQL statement or it can be a 4-tuple string separated by a comma (eg. UPDATE,tableName,columnName,value).

A message is sent by a client to a server process you create-- one that handles all the database transactions. When a message is sent, it is first handled by that server where the message is converted into an SQL query. If the query is successful, the message is saved to the MSMQ server. You can then have your server notify the subscribed clients after the message has been saved so that they can retrieve the message from the message inbox, or you can have the client poll the MSMQ server to check if there are new messages-- it's up to you.

You can visualize the architecture like this.

Client1---(Send)---->Server<--(Send)---Client2
Client3---(Send)------/ || \--------(Send)---Client4
...|................................||...............................|
...|.(Receive)................/..\...............................| (Receive)
...|............................./.....\..............................|
...|................DB Server.........MSMQ Server.......|
...\----------------------------------/ \--------------/
Nag try ako about dito sir, kaso wala akong mahanap nung auto receive ng message galing msmq
 
Nag try ako about dito sir, kaso wala akong mahanap nung auto receive ng message galing msmq

You have to code it in the client to receive a notification from msmq.

Ang tawag dyan "Push notification". Lahat ng subscribed clients padadalhan ng message.

Ang problema sa Push notification architecture is paano kung offline yung isa sa mga clients, say for example client1, then habang offline eh may isa pang client (client2) na nag update ng database? Eh di hindi makakarating kay client1 yung update ni client2.

I think in your case ang kailangan mo e Pull notification, which means nasa client ang decision ng pag download ng message.

Using MSMQ
1) Pwede ka gumawa ng MessageQueue sa server na 2 per client: isang outgoing at isang incoming.
2) Pwede ka rin gumawa ng isang incoming MessageQueue para sa lahat ng messages na pags-store-an ng mga clients at sya naman babasahin ng server, at isang outgoing MessageQueue na susulatan ng server na sya namang babasahin ng mga clients, or
3) Isang incoming queue lang at tig-iisang outgoing per client.

Sa tingin ko mas logical #1 compared to #2 and #3 although madami ka nga lang queue na kailangan i-manage. Yung #2 & #3 kailangan ma-identify ng server kung kaninong client galing yung mga messages sa incoming queue. Also, mahirap malaman kung sino huling client na magbubura ng message na nabasa na ng lahat sa #2 so kailangan mo i-keep track mga clients. Kasi nga lahat ng clients magbabasa sa iisang outgoing queue.

So halimbawa ganito ang scenario using #1
3 clients (all receptionist computers). Each client need access to their own public outgoing and incoming MessageQueues in the MSMQ.
1 server that has access to all 6 public MessageQueues in MSMQ.
1 database with some data already stored.
1 properly configured MSMQ server with 6 MessageQueues (2 each assigned to every client: one incoming the other outgoing).

Let's say lahat ng clients wala pang data sa datagrid view. Each client magpo-post ng SELECT query sa kanya-kanyang incoming queue sa server. Yung server meron event handler code for each incoming queue. So as soon as mag kick-in yung event, i-process ng server yung message. Format ng message is totally up to you pero it can be a String with this format: [SQL_COMMAND:SELECT,TABLE_NAME:MY_TABLE:COMMAND_ARGUMENTS:MY_ARGS]. Of course this means ico-convert mo yan into a valid SQL query bago mo ipasa sa DB.

Pag retrieve ng data sa DB i-coconvert mo ulit sa String (or better yet convert into XML or JSON). Then write the String sa outgoing queues ng every client.

Each client meron din event handler para sa outgoing queues. Once natapos na ang server i-write yung data for each outgoing queue magt-trigger naman ng event yung MessageQueue ng client.

Pag nag UPDATE naman kahit sinong client, yung message matapos i-process ng server store nya lang sa outgoing queue. So halimbawa yung scenario na sinabi ko na offline yung client1 dahil nag reboot then nag send ng update yung client2. Pag balik ng client1 mag send sya ng SELECT message dahil need nya lahat ng current data. Pero kung halimbawa na lag lang yung client1 at natagalan lang bumalik ang network, read nya lang yung outgoing queue nya from the server since may data pa naman yung client.

I hope mas clear na to sa first answer ko.

And here are the relevant links:
http://stackoverflow.com/questions/17600547/msmq-multiple-subscribers-and-event-notification
https://msdn.microsoft.com/en-us/library/k0syd8kf.aspx <-- nandito yung code kung paano gumawa ng event handler at kung paano mag bind ng event. However, C# yung code so you need to figure out how to write the equivalent VB.Net code.
 
Last edited:
You have to code it in the client to receive a notification from msmq.

Ang tawag dyan "Push notification". Lahat ng subscribed clients padadalhan ng message.

Ang problema sa Push notification architecture is paano kung offline yung isa sa mga clients, say for example client1, then habang offline eh may isa pang client (client2) na nag update ng database? Eh di hindi makakarating kay client1 yung update ni client2.

I think in your case ang kailangan mo e Pull notification, which means nasa client ang decision ng pag download ng message.

Using MSMQ
1) Pwede ka gumawa ng MessageQueue sa server na 2 per client: isang outgoing at isang incoming.
2) Pwede ka rin gumawa ng isang incoming MessageQueue para sa lahat ng messages na pags-store-an ng mga clients at sya naman babasahin ng server, at isang outgoing MessageQueue na susulatan ng server na sya namang babasahin ng mga clients, or
3) Isang incoming queue lang at tig-iisang outgoing per client.

Sa tingin ko mas logical #1 compared to #2 and #3 although madami ka nga lang queue na kailangan i-manage. Yung #2 & #3 kailangan ma-identify ng server kung kaninong client galing yung mga messages sa incoming queue. Also, mahirap malaman kung sino huling client na magbubura ng message na nabasa na ng lahat sa #2 so kailangan mo i-keep track mga clients. Kasi nga lahat ng clients magbabasa sa iisang outgoing queue.

So halimbawa ganito ang scenario using #1
3 clients (all receptionist computers). Each client need access to their own public outgoing and incoming MessageQueues in the MSMQ.
1 server that has access to all 6 public MessageQueues in MSMQ.
1 database with some data already stored.
1 properly configured MSMQ server with 6 MessageQueues (2 each assigned to every client: one incoming the other outgoing).

Let's say lahat ng clients wala pang data sa datagrid view. Each client magpo-post ng SELECT query sa kanya-kanyang incoming queue sa server. Yung server meron event handler code for each incoming queue. So as soon as mag kick-in yung event, i-process ng server yung message. Format ng message is totally up to you pero it can be a String with this format: [SQL_COMMAND:SELECT,TABLE_NAME:MY_TABLE:COMMAND_ARGUMENTS:MY_ARGS]. Of course this means ico-convert mo yan into a valid SQL query bago mo ipasa sa DB.

Pag retrieve ng data sa DB i-coconvert mo ulit sa String (or better yet convert into XML or JSON). Then write the String sa outgoing queues ng every client.

Each client meron din event handler para sa outgoing queues. Once natapos na ang server i-write yung data for each outgoing queue magt-trigger naman ng event yung MessageQueue ng client.

Pag nag UPDATE naman kahit sinong client, yung message matapos i-process ng server store nya lang sa outgoing queue. So halimbawa yung scenario na sinabi ko na offline yung client1 dahil nag reboot then nag send ng update yung client2. Pag balik ng client1 mag send sya ng SELECT message dahil need nya lahat ng current data. Pero kung halimbawa na lag lang yung client1 at natagalan lang bumalik ang network, read nya lang yung outgoing queue nya from the server since may data pa naman yung client.

I hope mas clear na to sa first answer ko.

And here are the relevant links:
http://stackoverflow.com/questions/17600547/msmq-multiple-subscribers-and-event-notification
https://msdn.microsoft.com/en-us/library/k0syd8kf.aspx <-- nandito yung code kung paano gumawa ng event handler at kung paano mag bind ng event. However, C# yung code so you need to figure out how to write the equivalent VB.Net code.

Kailangan ko pa po ba gumawa ng gui or module para sa server?
 
Back
Top Bottom