我收到此错误消息. [英] I get this error message.
本文介绍了我收到此错误消息.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Session["Answered"] = dt;
View v = this.View1;
Label l = default(Label);
l = (Label)v.FindControl("Label1");
l.Text = dt.Rows[ctr].Item["Serial"] + ".";
l = (Label)v.FindControl("Label2");
l.Text = dt.Rows[ctr].Item["question"];
Error 4 'System.Data.DataRow' does not contain a definition for 'Item' and no extension method 'Item' accepting a first argument of type 'System.Data.DataRow' could be found (are you missing a using directive or an assembly reference?) E:\Documents and Settings\Administrator\My Documents\Visual Studio 2010\WebSites\sravan\WebSite6\Default2.aspx.cs 38 31 E:\...\WebSite6\
推荐答案
DataRow
没有Item
属性-尝试引用该列...
DataRow
does not have anItem
property - try referencing the column instead...
l.Text = dt.Rows[ctr]["Serial"] + ".";
这篇关于我收到此错误消息.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文