Notify popup has been made.But the thing is if any changes made in database simultaneously the updated message is not being displayed in the notification popup.
Can anyone help me get out of it?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Tulpep.NotificationWindow;
using System.Data.SqlClient;
using System.Collections;
namespace NotificationPopup
{
public partial class NotificationPopup : Form
{
SqlCommand cmd;
SqlConnection con;
public NotificationPopup()
{
InitializeComponent();
}
PopupNotifier popup;
private void btnShow_Click(object sender, EventArgs e)
{
popup = new PopupNotifier();
popup.Image = Properties.Resources.notification;
popup.TitleText = "HELLO";
popup.ContentText = "WELCOME TO INDIA !";
popup.Popup();
}
ArrayList al;
int j;
private void timer1_Tick(object sender, EventArgs e)
{
if (j == 0)
{
con = new SqlConnection("Data Source=SALMAN\\SQLExpress;Database=MsDemo;Integrated Security=true");
cmd = new SqlCommand("SELECT Output FROM DemoOnPopup", con);
con.Open();
SqlDataReader dr = cmd.ExecuteReader();
al = new ArrayList();
while (dr.Read())
{
al.Add(dr[0].ToString());
i++;
}
}
popup = new PopupNotifier();
popup.Image = Properties.Resources.notification;
popup.BodyColor = Color.Yellow;
popup.ContentColor = Color.Black;
if (j
popup.ContentText = al[j].ToString();
popup.Popup();
if (timer1.Interval==500)
popup.Hide();
j++;
if (j == i)
timer1.Stop();
}
int i;
private void NotificationPopup_Load(object sender, EventArgs e)
{
}
}
}
6 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Amit GuptaPosted Mar 24, 2018, 2:15 AM
salman mohammadPosted Mar 25, 2018, 9:14 AM
Amit GuptaPosted Mar 25, 2018, 9:12 AM
salman mohammadPosted Mar 25, 2018, 8:44 AM
Amit GuptaPosted Mar 24, 2018, 9:18 AM
salman mohammadPosted Mar 24, 2018, 8:50 AM