Well, basically this is the problem.
First, I couldn't get it to work (database moved from another computer - owner issues - solved), now I can't get it to stop.

I have a table called birouri and I want to let's say update all the datagridviews of the clients where there's a change in the table.

Code
using System;
Code
using System.Collections.Generic;
Code
using System.ComponentModel;
Code
using System.Data;
Code
using System.Data.Sql;
Code
using System.Data.SqlClient;
Code
using System.Drawing;
Code
using System.Text;
Code
using System.Windows.Forms;
Code
using System.Security.Permissions;
Code
namespace TicheteC
Code
{
Code
    public partial class formBirouri : Form
Code
    {
Code
        private SqlCommand mCommand;
Code
        private string mSqlConnectString;
Code
        private int mChangeCount;
Code
        #region Permisiuni
Code
        private static bool CanRequestNotifications()
Code
        {
Code
            try
Code
            {
Code
                SqlClientPermission perm = new SqlClientPermission(PermissionState.Unrestricted);
Code
                perm.Demand();
Code
                return true;
Code
            }
Code
            catch
Code
            {
Code
                return false;
Code
            }
Code
        }
Code
        private void GetData()
Code
        {
Code
            this.ticheteDataSet.Clear();
Code
            mCommand = this.birouriTableAdapter.SelectCommand;
Code
            mCommand.Notification = null;
Code
            SqlDependency dependency;
Code
            dependency = new SqlDependency(mCommand);
Code
            dependency.OnChange += new OnChangeEventHandler(dependency_OnChange);
Code
            this.birouriTableAdapter.Fill(this.ticheteDataSet.birouri);
Code
            InfotoolStripStatusLabel.Text = String.Format("{0} change(s).", mChangeCount);
Code
        }
Code
        #endregion
Code
        public formBirouri()
Code
        {
Code
            InitializeComponent();
Code
        }
Code
       private void Birouri_Load(object sender, EventArgs e)
Code
        {
Code
            if (CanRequestNotifications() == true)
Code
            {
Code
                mSqlConnectString = this.birouriTableAdapter.Connection.ConnectionString;
Code
                SqlDependency.Stop(mSqlConnectString);
Code
                SqlDependency.Start(mSqlConnectString);
Code
                GetData();
Code
            }
Code
        }
Code
        private void birouriBindingNavigatorSaveItem_Click(object sender, EventArgs e)
Code
        {
Code
            this.Validate();
Code
            this.birouriBindingSource.EndEdit();
Code
            this.birouriTableAdapter.Update(this.ticheteDataSet.birouri);
Code
        }
Code
Code
        private void Birouri_FormClosed(object sender, FormClosedEventArgs e)
Code
        {
Code
            SqlDependency.Stop(mSqlConnectString);
Code
        }
Code
        private void dependency_OnChange(object sender, SqlNotificationEventArgs e)
Code
        {
Code
            ISynchronizeInvoke i = (ISynchronizeInvoke)this;
Code
            if (i.InvokeRequired)
Code
            {
Code
                OnChangeEventHandler tempDelegate = new OnChangeEventHandler(dependency_OnChange);
Code
                object[] args = { sender, e };
Code
                i.BeginInvoke(tempDelegate, args);
Code
                return;
Code
            }
Code
           SqlDependency dependency = (SqlDependency)sender;
Code
           dependency.OnChange -= dependency_OnChange;
Code
           ++mChangeCount;
Code
           GetData();
Code
        }
Code
Code
    }
Code
}


The problem is that the datagridview keeps on updating. Can anyone see if there's something wrong with the code ?