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,770 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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 how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

739 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