对asp.net债务比较的怀疑 [英] doubt in asp.net abt comparison

查看:88
本文介绍了对asp.net债务比较的怀疑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码


hi this is my code


adp = new SqlDataAdapter("select tenderamount from tender", con);
       ds = new DataSet();
       adp.Fill(ds, "tender");
       if (ds.Tables["tender"].Rows.Count > 0)
       {
           if (TextBox5.Text > ds.Tables["tender"].Rows[0][1].ToString())
           {
               Response.Redirect("Payment.aspx?BidAmount=" + TextBox5.Text + "&TenderName=" + DropDownList1.Text);
           }
           else
           {
               Label3.Text = "sorry Your bid amount is low";
           }
       }




我想在sql中比较数据形式的文本框和表值,那么只有它会重定向到新页面,请帮助我,我现在就去整理它




i want to compare the data form textbox and table value in sql then only it will redirect to new page, pls help me, i wnt to finsh it now

推荐答案

if (TextBox5.Text > ds.Tables["tender"].Rows[0][1].ToString()).您正在使用>运算符比较两个字符串.这可能无法正常工作.

如果这些值是数字,请使用

if (Convert.ToInt32(TextBox5.Text) > Convert.ToInt32(ds.Tables["tender"].Rows[0][1].ToString()))
if (TextBox5.Text > ds.Tables["tender"].Rows[0][1].ToString()). You are comparing two string with > operator. This may not work well.

If those values are numbers then use

if (Convert.ToInt32(TextBox5.Text) > Convert.ToInt32(ds.Tables["tender"].Rows[0][1].ToString()))


这篇关于对asp.net债务比较的怀疑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆