我得到一个错误标识符 [英] iam getting an error identifier expected
本文介绍了我得到一个错误标识符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
DataRow dr = dt.NewRow();
dr["id"] = i;
dr["Name"] = "Name" + i;
dr["Branch"] = Branches[brnc.Next(0, 3)];
dr["Age"] = ag.Next(17, 22);
dr["SocialMarks"] = marks1.Next(50, 100);
dr["MathsMarks"] = marks2.Next(50, 100);
dr["ScienceMarks"] = marks3.Next(50, 100);
dr["TotalMarks"] = dr.["SocialMarks"] +dr.["MathsMarks"] +dr.["ScienceMarks"];
dr["AverageMarks"] =dr.[ "TotalMarks"] / 3.0;
推荐答案
检查拼写:ag应该是年龄吗?
Check your spelling: was "ag" supposed to be "age"?
dr["Age"] = ag.Next(17, 22);
或许:
Perhaps:
dr["Age"] = age.Next(17, 22);
如果那不是'它,双击Visual Studio中的错误消息,它将直接到你不喜欢的行,在该术语下面的红线是抱怨 - 错误很可能是接近,但没有硝酸钾我们只是猜测哪条线。
If that isn't it, double click the error message in Visual Studio, and it will take you directly to the line that it doesn't like, with a red line below the term is it complaining about- the error is likely to be close, but without knowing which line we would just be guessing.
这篇关于我得到一个错误标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文