当前位置: 代码迷 >> ASP.NET >> 初级有关问题,请各位帮忙
  详细解决方案

初级有关问题,请各位帮忙

热度:6720   发布时间:2013-02-25 00:00:00.0
初级问题,请各位帮忙
类似搜索页面,因为判断条件多,求一个简单些的方法,我写的好烦琐,下面就是我写的,还只是一部分的判断呢,请帮忙

    if   (topCount1   ==   " "   ||   topCount1   ==   null)
                {
                        if   (other1   ==   "1 ")
                        {
                                DB1   db1   =   new   DB1();
                                string   Sql   =   "select   *   from   ProductBaseInfo ";
                                db1.SetDataBinding(dg,   Sql);
                                db1.CloseDataBase();
                        }
                        if   (other1   ==   "2 ")
                        {
                                DB1   db1   =   new   DB1();
                                string   Sql   =   "select   *   from   ProductBaseInfo ";
                                db1.SetDataBinding(dg,   Sql);
                                db1.CloseDataBase();
                        }
                        if   (other1   ==   "3 ")
                        {
                                DB1   db1   =   new   DB1();
                                string   Sql   =   "select   *   from  
                                db1.SetDataBinding(dg,   Sql);
                                db1.CloseDataBase();
                        }
                        if   (other1   ==   " "   ||   other1   ==   null)
                        {
                                DB1   db1   =   new   DB1();
                                string   Sql   =   "select   *   from   ProductBaseInfo  
  相关解决方案