使用存储过程方法在标签控件中显示数据 [英] show data in label control using stored procedure method
本文介绍了使用存储过程方法在标签控件中显示数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
喜!朋友,
i希望用标签控件显示我的数据,使用存储过程方法PLZ任何人帮助我..
提前感谢...
hi! friends,
i wants to show my data in label control using stored procedure method plz any one help me..
thanks in advance...
推荐答案
//Your Connection Here
SqlCommand comm = new SqlCommand();
comm.Connection = ConnectionName;
comm.CommandType = CommandType.StoredProcedure;
comm.CommandText = "StoredProcedureName";
SqlDataReader dr;
dr = comm.ExecuteReader();
if (dr.HasRows == true)
{
dr.Read();
Label1.Text = dr["DataField"].ToString();
dr.Close();
}
这篇关于使用存储过程方法在标签控件中显示数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文