For Programmers: Free Programming Magazines  


Home > Archive > ASP .NET > June 2007 > Re: Why am I getting the error: 'ListWriteTime' was not found on the selected data so









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Why am I getting the error: 'ListWriteTime' was not found on the selected data so
Steve Kershaw

2007-06-28, 7:11 pm

On Jun 28, 2:39 pm, Steve Kershaw <steve_kers...@yahoo.com> wrote:
> Hello,
>
> I'm trying to bind a DirectoryInfo array to a GridView
> (.DataBind();).
> Whenever I hit the gridDirList.DataBind(); method I get the error:
>
> A field or property with the name 'ListWriteTime' was not found on the
> selected data source.
>
> Can somebody explain this error and what I can do to avoid it?
> I've googled this error and 'ListWriteTime' and I don't get any
> results.
>
> Thanks so much.
>
> Steve


So Sorry I got a little too quick with the mouse.
I forgot to add my code:

// Define the current directory
DirectoryInfo dir = new DirectoryInfo(path);

// Get the Directory info arrays for the dir and files
FileInfo[] files = dir.GetFiles();
DirectoryInfo[] dirs = dir.GetDirectories();

// bind to the GridView
gridDirList.DataSource = dirs;
gridDirList.DataBind();

Thanks again.

Steve

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com