Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 18th, 2005, 02:23 PM
Authorized User
 
Join Date: May 2005
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default C# If test not working

I'm trying to do an if test to disply a message if a record value in a db is less than 3, but it displays the message always, see code below. Also I'm looking for some sample code of a comboBox in C#, I want to populate the combox using a stored procedure, any examples appreciated.

SqlDataAdapter da = new SqlDataAdapter
    ("SELECT MAX(FeedbackId) as FeedbackId, ComfortLevel from Feedbacks GROUP BY FeedbackId, ComfortLevel", StrConnection);
    DataSet ds = new DataSet();
     da.Fill(ds,"Feedbacks");

     foreach (DataRow dr in ds.Tables["Feedbacks"].Rows)

     {
         int id = (int)dr["ComfortLevel"];
         if (id == 3)
            {
                 message2.Text = "Contact a tutor";
            }

     }





Similar Threads
Thread Thread Starter Forum Replies Last Post
window.opener working .... not working alyeng2000 Javascript How-To 5 January 5th, 2007 08:05 AM
Web.Config..Working or Not Working peace95 ASP.NET 1.0 and 1.1 Basics 1 September 18th, 2006 06:53 AM
C# If test not working RichardOrmiston C# 7 December 20th, 2005 08:18 AM
Local COM working , but not working at Web Serv nagen111 .NET Web Services 3 February 19th, 2005 04:22 AM
IIS test not working kevi3032 ASP.NET 1.0 and 1.1 Basics 21 December 20th, 2004 02:43 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.