Results 1 to 2 of 2

Thread: Pop up reminder on windows application using C#?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2007
    Posts
    208

    Pop up reminder on windows application using C#?

    I am developing desktop application. i am using ms sql and C#.
    testtable records.
    noteid notetitle notelocation notedescription
    101 Meles Zenawi Mekele meeting
    102 Tigray Mekele northern star
    103 Maineberi Mekele southern star
    104 Axum axum centeral



    now i have a form called "reminder" which is used for displaying data on loading of the page.
    i want to display 3 dialog box(popup box) when the page is loading.... here is my code
    Code:
     private void rentalfrm_Load(object sender, EventArgs e)
            {
    
             
                string  city="Mekele";
    sqlDataReader drnote;
          
             string    selectdata = "select noteid,notetitle from remindernotetbl where notelocation='"+city+"'";
    
                SqlCommand cmdnote = new SqlCommand(selectdata, dbcon);
    
                drnote = cmdnote.ExecuteReader();
               
      
                while(drnote.Read())
                {
                  
                    reminder rem = new reminder();
                    rem.ShowDialog();
                    }
                   
                //drdate.Close();
    
                dbcon.Close();
    }
    This code not work correctly. it shows me 3 dialog box(pop up form of "reminder") but only retrieved the first row.
    i want to see 3 dialog box(pop up form) with the 3 records on the row.
    any help please

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: Pop up reminder on windows application using C#?

    All we can see from that code is that you're displaying a dialogue for each record. There's no indication that you're actually reading any of the data from the data reader.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width