Gridview and Filtering problem

D

Damien

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
 
C

CaffieneRush

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>
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top