What's new

Help Remote Access Xampp

a2zyyz

Addict
Established
Joined
Dec 7, 2020
Posts
120
Reaction
24
Points
98
Hello po mga sir

paano po gawing realtime ung adding delete update sa mysql gamit xampp sa vb.net po

bale 5 pc po icoconect ko doon sa server kapag nag add si client ng data dapat po mag aappear na sya sa datagrid ng main server bale realtime po siya

everytime po na may gagawin ang client add/update/delete automatic na mag fefeedback realtime po sa server

eto po ung sa connection ko

Public connectionstring As String = "Server=192.168.55.10;port=3306;uid=studentinfo;database=clinicdb;password=;"

maraming salamat po sa makakatulog
 
Hello! Para gawing realtime ang adding, deleting, at updating ng data sa MySQL gamit ang XAMPP sa VB.NET, maaari mong gamitin ang MySQL triggers at VB.NET timers para mag-refresh ang data sa datagrid ng main server.

Narito ang mga steps na maaari mong gawin:

1. Triggers sa MySQL:
- Gumawa ng MySQL triggers sa iyong database na magsasagawa ng action kapag may mga changes sa data. Halimbawa, kapag may nag-add, update, o delete ng data sa client side, mag-ttrigger ang MySQL para i-update ang main server.

2. VB.NET Timer:
- Gumamit ng VB.NET Timer control para mag-refresh ng data sa datagrid ng main server sa regular intervals. Maaari mong i-set ang timer interval depende sa kadalasan ng pag-update ng data o depende sa kung gaano ka-realtime mo gustong makuha ang updates.

3. Sample Code:
- Narito ang sample code na maaari mong gamitin para mag-refresh ng data gamit ang VB.NET Timer:

Code:
vb.net
Dim WithEvents timer As New Timer()

Private Sub Form_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    timer.Interval = 5000 ' Refresh every 5 seconds (adjust as needed)
    timer.Start()
End Sub

Private Sub timer_Tick(sender As Object, e As EventArgs) Handles timer.Tick
    ' Dito mo ilalagay ang code para i-refresh ang datagridview ng main server
    ' Halimbawa:
    ' DataGridView1.DataSource = GetDataFromDatabase()
End Sub

4. Exception Handling:
- Siguraduhing magkaroon ng exception handling sa iyong code para ma-handle ang mga error na maaaring mangyari habang nagre-refresh ng data.

5. Iba pang Considerations:
- Siguraduhing tama at secure ang iyong connection string at access control sa database para maiwasan ang security risks.
- Maari mo ring gamitin ang iba pang third-party tools o libraries para mas mapadali ang realtime data synchronization.

Nawa'y makatulong sa iyo ang mga steps na ito para gawing realtime ang pag-update ng data sa MySQL gamit ang XAMPP sa VB.NET. Kung may iba ka pang katanungan, huwag kang mag-atubiling magtanong!
 
bale sir eto pong timer ilalagay sa server sa mismong form..

ang ginawa ko po kc is mag kaibang project isang client na project at isang server na project bale dalawang software iisa lang po ang database
 
Wala po yan kanalaman ang pag share ng connection string mo sa database
ang need mo po i-dagdag para mag updated ang data ng application mo mag lagay ng timer or background worker

bale sir eto pong timer ilalagay sa server sa mismong form..

ang ginawa ko po kc is mag kaibang project isang client na project at isang server na project bale dalawang software iisa lang po ang database
Yes
 
Wala po yan kanalaman ang pag share ng connection string mo sa database
ang need mo po i-dagdag para mag updated ang data ng application mo mag lagay ng timer or background worker


Yes
Paano po ung background worker sir?

Wala po yan kanalaman ang pag share ng connection string mo sa database
ang need mo po i-dagdag para mag updated ang data ng application mo mag lagay ng timer or background worker


Yes
bale po ba ang icacall ko lang sa timer is ung pag populate ng datagrid ko from database?

parang call Populatedatagrid after ng 5 seconds?
 
Last edited:
Paano po ung background worker sir?


bale po ba ang icacall ko lang sa timer is ung pag populate ng datagrid ko from database?

parang call Populatedatagrid after ng 5 seconds?
Yes add mo ang function sa timer ang nag re-retreive ng data or ss mo na lang code mo see ko
 
Private Sub frmtimein_Load(sender As Object, e As EventArgs) Handles MyBase.Load

Timer1.Interval = 5000
Timer1.Start()
pop_EnrolledStudents()
ultraconnection()

End Sub

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick


pop_EnrolledStudents()



End Sub

ganyan po ba sir?
 
Private Sub frmtimein_Load(sender As Object, e As EventArgs) Handles MyBase.Load

Timer1.Interval = 5000
Timer1.Start()
pop_EnrolledStudents()
ultraconnection()

End Sub

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick


pop_EnrolledStudents()



End Sub

ganyan po ba sir?
Visual Basic eto? Pasensya late sa reply nag loko nanaman notif PHC pero pm mo po ako kung hindi pa na fix

Visual Basic eto? Pasensya late sa reply nag loko nanaman notif PHC pero pm mo po ako kung hindi pa na fix
Code:
Public Class MainForm <~ this is just my example yours is different
    Private WithEvents Timer1 As New Timer

    Public Sub New()

        InitializeComponent()
        Timer1.Interval = 5000 ' Set the timer interval to 5 seconds
        Timer1.Start()
        pop_EnrolledStudents()
        ultraconnection()

    End Sub

    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick

        ' Call the function to retrieve data
        pop_EnrolledStudents()

    End Sub

    Private Sub pop_EnrolledStudents()

        ' This is where you put the code to retrieve data
        ' For example, you might query a database or make a web request here

    End Sub

End Class
 
Last edited:
Visual Basic eto? Pasensya late sa reply nag loko nanaman notif PHC pero pm mo po ako kung hindi pa na fix


Code:
Public Class MainForm <~ this is just my example yours is different
    Private WithEvents Timer1 As New Timer

    Public Sub New()

        InitializeComponent()
        Timer1.Interval = 5000 ' Set the timer interval to 5 seconds
        Timer1.Start()
        pop_EnrolledStudents()
        ultraconnection()

    End Sub

    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick

        ' Call the function to retrieve data
        pop_EnrolledStudents()

    End Sub

    Private Sub pop_EnrolledStudents()

        ' This is where you put the code to retrieve data
        ' For example, you might query a database or make a web request here

    End Sub

End Class
opo

Visual Basic eto? Pasensya late sa reply nag loko nanaman notif PHC pero pm mo po ako kung hindi pa na fix


Code:
Public Class MainForm <~ this is just my example yours is different
    Private WithEvents Timer1 As New Timer

    Public Sub New()

        InitializeComponent()
        Timer1.Interval = 5000 ' Set the timer interval to 5 seconds
        Timer1.Start()
        pop_EnrolledStudents()
        ultraconnection()

    End Sub

    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick

        ' Call the function to retrieve data
        pop_EnrolledStudents()

    End Sub

    Private Sub pop_EnrolledStudents()

        ' This is where you put the code to retrieve data
        ' For example, you might query a database or make a web request here

    End Sub

End Class
thank you sir
 
Back
Top