将数据绑定到Web [英] binding data to webfrom
本文介绍了将数据绑定到Web的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在菜单上单击,我想将存储过程返回的数据绑定到一个.aspx Webform(其中包含一些标签,并且我希望将从storageproc返回的数据集/数据表的每一行绑定到Webform中的特定标签).
示例或建议将不胜感激.
谢谢!
on menu click i would like to bind data returned from stored procedure to a .aspx webform(which contains some labels and I would like to bind each row of dataset/datatable returned from storedproc to a specific label in the webform).
examples or suggestions would be appreciated.
Thanks!
推荐答案
这可能对你有帮助!
This one may help U !
DataTable dt = new DataTable();
StringBuilder str = new StringBuilder();
dt = _linqdataaccess.functionName(); // call stored procedure
for(int i=0;i< dt.Rows.Count;i++)
{
if (dt.Rows[0]["model"]ToString() != "")
{
str.Append("<b>Content:</b> " + dt.Rows[i]["model_no"].ToString() + "<br />");
}
}
lblcontact.Text = str.ToString();
这篇关于将数据绑定到Web的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文