Click here to Skip to main content
12,072,067 members (60,631 online)
Rate this:
 
Please Sign up or sign in to vote.
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>


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!! :(
Posted 28-Nov-11 22:13pm
Edited 28-Nov-11 22:36pm
v3

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

you can try this
use
da.Fill(ds,"tablename");
instead of
da.Fill(ds);
hope it will helps

for above error see this thread
procedure-maximum-stored-procedure-function-trigger-or-view-nesting-level-exc
  Permalink  
v3
Comments
07navneet 29-Nov-11 4:13am
   
I have tried it but didnt work!
Uma Shankar Patel 29-Nov-11 4:56am
   
share stored procedure code
07navneet 29-Nov-11 5:22am
   
Stored Procedure:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[getdata]
as
begin
select*from emp
end
07navneet 30-Nov-11 5:21am
   
Please help, somebody!
Uma Shankar Patel 30-Nov-11 10:20am
   
It runs successfully.It have no problem.
07navneet 1-Dec-11 5:09am
   
Sir, is there a problem in my PC, due to which its not executing this code properly??
Uma Shankar Patel 1-Dec-11 5:32am
   
try to bind with direct query.
Uma Shankar Patel 1-Dec-11 5:36am
   
once try, may be it run.
SqlConnection con = new SqlConnection(str_con);
con.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection=con;
cmd.CommandText="getdata";
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);<<------------error
DataList1.DataSource = ds;
DataList1.DataBind();
con.Close();
07navneet 3-Dec-11 2:03am
   
Sorry! But getting same result. Also my previously asked question was also unsolved and till now I am not able to perform DML operations(insert/update/delete) using ASP.NET.
I am about to give up with ASP.NET!!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web04 | 2.8.160208.1 | Last Updated 29 Nov 2011
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100