Gridview and Filtering problem

Discussion in 'ASP .Net Web Controls' started by Damien, May 31, 2006.

  1. Damien

    Damien Guest

    Hi,
    I am trying to populate a gridview with a dataset and filter with the
    following code

    DataSet ds = DataFactory.GetProjectSubTasksAndEst
    (m_iProjectID,p_iProjectTaskID, p_iProjectSubTaskID);

    string sFilter = "pk_WeekEndingDate = '2006-05-07'";

    gvTasksAndEstimates.DataSource = ds.Tables[0].Select(sFilter);
    gvTasksAndEstimates.DataBind();

    but the following produces 4 rows but instead of the information i expect it
    produces 4 rows of a haserrors checkbox and rowerror.

    Can anyone please tell me where im going wrong with this

    Cheers D
     
    Damien, May 31, 2006
    #1
    1. Advertisements

  2. Damien

    CaffieneRush Guest

    Sounds like an ADO.Net problem rather than a ASP.Net problem.
    The problem could be in:
    1. DataFactory.GetProjectSubTasksAndEst() - this is the most likely
    problem. I'm guessing that there was a problem populating the dataset.
    The dataadapter's FillError handler was set to continue with the fill
    operation rather than fail with an exception and mark that particular
    row with an error.
    You can check the returned dataset for errors and handle it as you see
    fit.
    Example code:
    <http://msdn2.microsoft.com/en-us/library/system.data.datarow.rowerror.aspx>

    2. ds.Table[0].Select(sFilter) - highly unlikely as it should throw an
    exception at this point and not proceed onto the DataBind.

    Regards,
    Andy

    ps. The folks over in the ADO.Net group can probably give you better
    help.
    Try this one
    <http://groups.google.com/group/microsoft.public.dotnet.framework.adonet?lnk=li>
     
    CaffieneRush, May 31, 2006
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.