On Jun 28, 2:39 pm, Steve Kershaw <steve_kers...@yahoo.comwrote:
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