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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now