听到错误如何解决此问题 [英] hear got error how to rectify this

查看:70
本文介绍了听到错误如何解决此问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Label l = default(Label);
		l = (Label)v.FindControl("Label1");
		l.Text = dt.Rows[ctr]["Serial"] +  ",";
		l = (Label)v.FindControl("Label2");
        dt.Rows[ctr]["question"] = l.Text;




我收到错误l.Text = dt.Rows [ctr] ["Serial"] +,";在此行中没有行.




I got error l.Text = dt.Rows[ctr]["Serial"] + ","; in this line there is no position at row.

cmd.Parameters["@password"].Value = this.TextBox2.Text;

      SqlDataReader dr = null;

      dr = cmd.ExecuteReader();

      if (dr.HasRows)
      {




我在这一行出现了错误dr = cmd.ExecuteReader();


感谢valuabel replay




i got error in this line dr = cmd.ExecuteReader();


thanks for valuabel replay

推荐答案

您的代码似乎不完整或不知道您想做什么.

Your code seems incomplete or dont know what you want to do.

dt.Rows[ctr]["Serial"]



在此代码中,什么是ctr,行是锯齿状数组,其中第一个边界是columnName/Id,第二个边界是RowID/RownNumber,因此您的代码应类似于-



In this code what is ctr, Rows is jagged array where first boundary is columnName/Id and second boundary is RowID/RownNumber so your code should be like -

dt.Rows[ColumnName/ID][RowID] 



您打算如何使用此代码?

问候
鲁西(Rushi)



What are you trying to do with this code?

Regards
Rushi


subbu,

我认为您的cmd对象不会返回这些值.因此,您正在获得此期望.
只需在Sql Server Management Studio中执行querey,就会发现所犯的错误.

希望有更多问题,请发送查询.
Hi subbu,

i think your cmd object do not return the values.So you are getting this expcetion.
Just execute your querey in Sql Server Management Studio,you will find the mistake you committed.

I hope it helps you, any more problem,please send a query.


这篇关于听到错误如何解决此问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆