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,761 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

770 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