使用过程/数据集绑定数据列表 [英] binding datalist using procedure/dataset

查看:170
本文介绍了使用过程/数据集绑定数据列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行时错误-超过最大存储过程,函数,触发器或视图嵌套级别

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


这篇关于使用过程/数据集绑定数据列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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