The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

Datagrid and Stored procedure

Last post 04-21-2008, 12:59 PM by dewacorp.alliances. 2 replies.
Sort Posts: Previous Next
  •  04-20-2008, 8:53 PM 8947

    Datagrid and Stored procedure

    Hi there

    I am trying to figure out why my grid is not working. Basically I am using a simple grid:

    Front end:

     

    Code:
    "server" ID="grvwTest" AutoGenerateColumns=true>

     

    Code behind: 

     

    Code:
    TndFileConsumptionDetailCollection fileConsumptionDistributor = new TndFileConsumptionDetailCollection();
    fileConsumptionDistributor.GetScheduleConsumption(Convert.ToInt32(ViewState["FileConsumptionID"].ToString()), 1);
    grvwTest.DataSource = fileConsumptionDistributor;
    grvwTest.DataBind();

    Custom Class:

     

    Code:
    public partial class TndFileConsumptionDetailCollection : esTndFileConsumptionDetailCollection
    	{
            public bool GetScheduleConsumption(int FileConsumptionID, int ScheduleGroupID)
            {
                esParameters oParameters = new esParameters();
                oParameters.Add("FileConsumptionID", FileConsumptionID);
                oParameters.Add("ScheduleGroupID", ScheduleGroupID);
                return this.Load(esQueryType.StoredProcedure, "tnd_GetScheduleConsumption", oParameters);
            }
    	}
     

     

    Stored procdedure:
    SELECT * FROM #Amount
    (return temp table)
     
    I debug and it's has 7 rows records coming in from the collection but couldn't populate the grid from some reason. 
    Any ideas?
    Thanks 
     



     

  •  04-21-2008, 4:42 AM 8950 in reply to 8947

    Re: Datagrid and Stored procedure

    Try this:

    grvwTest.DataSource = fileConsumptionDistributor.LowLevelBind();


    and see what happens.

    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  04-21-2008, 12:59 PM 8957 in reply to 8950

    Re: Datagrid and Stored procedure

    Hi Mike

    Thanks for this. It works. :) BTW what is the LowLevelBind() method and how come with a bit different with normal binding?

    Thanks

     

     

View as RSS news feed in XML