日期:2014-05-19  浏览次数:20482 次

HELP!!!!!!!!!!!!!!
如果数据库返回的结果为空的话,我想写一句话:   "你想查的结果不存在   " ,该怎么写????

OleDbConnection   myConnection   =   cn;
DataSet   ds     =   new   DataSet();
OleDbDataAdapter   adapter     =   new   OleDbDataAdapter( "select   *   from   db   where   ip> 100 ",   myConnection);
adapter.Fill(ds,   "lpan ");
MyDataGrid.DataSource   =   ds.Tables[ "lpan "].DefaultView;
MyDataGrid.DataBind();

------解决方案--------------------
if(ds.Tables[0].Rows.Count ==0)
{

result.Text = "没有查到你想要的结果 ";

}
------解决方案--------------------
if(ds.Tables[0].Rows.Count ==0)
{

xxxxxxxxxx
}