使用过程/数据集绑定数据列表
问题描述:
运行时错误-超过最大存储过程,函数,触发器或视图嵌套级别
html:
在DataList中:-
error on runtime-Maximum stored procedure, function, trigger, or view nesting level exceeded
html:
In DataList:-
<itemtemplate>
<tr>
<td>
<%#Eval("e_id") %>
</td>
<td>
<%#Eval("e_name") %>
</td>
<td>
<%#Eval("e_sal") %>
</td>
</tr>
</itemtemplate>
代码(.cs):
code(.cs):
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(str_con);
con.Open();
SqlCommand cmd = new SqlCommand("getdata", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);<<------------error
DataList1.DataSource = ds;
DataList1.DataBind();
con.Close();
它工作正常,但现在相同的代码给出了错误! :(
It was working fine but now same code is giving error!! :(
答
您可以尝试一下
使用
you can try this
use
da.Fill(ds,"tablename");
代替
da.Fill(ds);
希望对您有帮助
有关上述错误,请参见此线程
procedure-maximum-stored-procedure-function-触发器或视图嵌套级别的exc
hope it will helps
for above error see this thread
procedure-maximum-stored-procedure-function-trigger-or-view-nesting-level-exc