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

Title # Comments Views Activity
wild fly 8 startup error 2 40
Problem to copy file 14 50
Include MS Database in Winforms Project using Intellilock 5 21
Convert VB web project to C# 3 37
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This video teaches viewers about errors in exception handling.

749 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