我写了以下几行代码来从数据库中检索数据。当我检查一个标签时,它表明数据表中有数据,但无法在gridview中显示数据。谁能提出任何解决方案。谢谢!
DataSetTableAdapters.retrievebookingTableAdapter rta = new dataSetTableAdapters.retrievebookingTableAdapter();
DataSet.retrievebookingDataTable rdt;
rdt = rta.GetData(EmailID.Text);
GridView1.DataSource = rdt;
GridView1.DataBind();
if (rdt == null)
{
Label1.Visible = true;
Label1.Text = "No data found";
}
else
{
Label1.Visible = true;
Label1.Text = "data exists";
}