Solved

Mbox, messagebox.show, window alert? Need a hand with a message box pop up, depending on the results of an If statement

Posted on 2008-11-03
3
4,766 Views
Last Modified: 2013-12-17
Hello, basically what i need is a message box pop up that will either say 'this project exists, please select another' if the IF is true else 'project doesnt exist please carry on process'. I tried a few ways already but from looking on here I see Java script is favoured....unluckly my java knowledge is limited.

Any help is much appreciated thanks!
protected void btnProjSearch_Click(object sender, EventArgs e)
    {
 
        string OracleConnectionStringBuilder = "Data Source=TEST;User Id=***;Password=****";
 
        OracleConnection myConnection = new OracleConnection(OracleConnectionStringBuilder);
        myConnection.Open();
 
 
        string commandString2 = "SELECT PROJECTNO FROM P_AMASTER WHERE PROJECTNO like '" + txtProjNo.Text + "'";
 
    OracleCommand myCommand2 = new OracleCommand(commandString2, myConnection);
 
    OracleDataReader myReader2 = myCommand2.ExecuteReader();
    myReader2.Read();
 
        if (myReader2.HasRows)
        {
          
        }
        else
        {
 
        }
 
        
        myReader2.Close();   
        }
    }

Open in new window

0
Comment
Question by:dwezil
  • 3
3 Comments
 
LVL 24

Expert Comment

by:sciuriware
ID: 22866020
JOptionPane


;JOOP!
0
 
LVL 24

Accepted Solution

by:
sciuriware earned 500 total points
ID: 22866045
        JOptionPane.showMessageDialog                        // For errors:
         (
            parent,                                                              // Your JFrame
            message.startsWith("<HTML>")                        // My own invention ....
               ? message
               : "<HTML><CENTER><STRONG STYLE=\"color:red\">" + message,
               title == null ? "Error" : title,                            // give 'title' ...
            JOptionPane.ERROR_MESSAGE,
            myErrorIcon                                                       // Provide an ImageIcon
         );

;JOOP!
0
 
LVL 24

Expert Comment

by:sciuriware
ID: 22886910
B?
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

829 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