Solved

how to pop a message for a change in the database?

Posted on 2014-12-12
2
271 Views
Last Modified: 2014-12-13
hi
so im using visual studio 2010, making a winform vb.net...
i have a bindingNavigator, im connecting and using database here but, i connect using visual studio tools, im not fully typing the whole thing, so, basically i used a binding navigator, and the thing is that when a certain calculation appears (through the use of timer or not) the record do get affected and i get the results i want and it will be stored,  only thing, is that when this change happens i pop a msgbox, problem is that change happens through all the records i need, but pops a msgbox only for the record that the bindingNavigator is currently on! i was thinking to loop through the datatables or something but dont know how about..

sample:
Private Sub picturebox_VisibleChanged(sender As System.Object, e As System.EventArgs) Handles picturebox.VisibleChanged

        If picturebox.Visible = True Then
            If MessageBox.Show("FIRE SAFETY, DATE NEAR, SO, A MONTH EXTENSION?", "ALMOST DUE" & vbNewLine, MessageBoxButtons.YesNo) = DialogResult.Yes Then
                FIRESAFETYTESTDateTimePicker.Value = FIRESAFETYTESTDateTimePicker.Value.AddDays(31.0)
               
            Else
                Exit Sub
            End If
        End If
    End Sub

this will take place if i navigate to (it)....through binding navigator....
any tips please?
thanks
0
Comment
Question by:ahashash
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 82

Accepted Solution

by:
David Johnson, CD, MVP earned 250 total points
ID: 40497931
you're not explaining it enough .. do you have a list of events stored in a database and if the date/time is within x days/hours etc you want a message to be displayed once you reach the end of the list you have to  rereadi the database because a new event may have been entered that meet your criteria.

Perhaps a better idea is a listbox that does a select * from db.event where date equals the date range.. If no events then don't show listbox. you can refresh using a timer
0
 
LVL 40

Assisted Solution

by:Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger) earned 250 total points
ID: 40498245
I do not work with the BindingNavigator, because it causes side problems that are not easy to understand when they happen.

But I question the choice of the VisibleChanged event to place that code. Typically, VisibleChanged is called only once, when the form first appears on the screen. It seems odd to me that you display a MessageBox about something in the database in an event that has to do with something that deals with the fact that a control is Visible or not.

In order to change later, it's Visible property needs to be called somewhere. Is this something you do in your form? The fact that the Visible property change can also be one the side effects of using a BindingNavigator. In each case, you might need to place your MessageBox code somewhere else, or see if the code that makes the Visible property change on and on is pertinent.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question