caizhen66
caizhen66
2017-02-20 15:47

用数据集DataSet绑定的数据怎样传到Label控件上?

  • c#

在数据访问层
public class TradeService
{
static StringBuilder sb = new StringBuilder();
//连接数据库获取用户订票数据
public static DataSet GetTrade()
{
DataSet ds = null;
try
{
SqlConnection conn = new SqlConnection(DBHelper.connString);
string sql = "………查询语句省略………";
SqlDataAdapter ad = new SqlDataAdapter(sql, conn);
ds = new DataSet();
if (ds.Tables["tradeList.seatNO"] != null)
{
ds.Tables["tradeList"].Clear();
}
ad.Fill(ds, "tradeList");

        }
        catch (Exception ex)
        {

            throw ex;
        }

        return ds;

    }

}
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答