473,320 Members | 2,094 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Why am I getting the error: 'ListWriteTime' was not found on the selected data source.

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

Jun 28 '07 #1
2 1448
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

Jun 28 '07 #2
Hi Steve,

Steve Kershaw schrieb:
>I'm trying to bind a DirectoryInfo array to a GridView
(.DataBind();).

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.
The error message means that your aspx file tries to find a property
named ListWriteTime in each DirectoryInfo object and to output the value
of that property somewhere in your aspx file. However, DirectoryInfo
does not have a property named ListWriteTime (with an i).
I suppose you meant LastWriteTime (with an a) and just mistyped it in
your aspx file.

Hope this helps.

Cheers,

Roland
Jun 29 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: JR | last post by:
I am attempting to display two list boxes. In the first list box is a listing of all entities. When a entity is selected and it has a subentity the second list box displays with a list of the...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
7
by: astro | last post by:
Anyone have suggestions on where to troubleshoot this error? Background: -Access 2k v. 9.0.6926 sp3 - front and backend on production server (wiindows 2k) -accessed via Citrix -front-end is...
0
by: Alpha | last post by:
I have a dataset containing a table as a data source for a list box in the windows application depending on which radio button the user selects. The table is disposed when the user clicks on other...
6
by: Teep | last post by:
Below is my code for dropdownlist that is populated from a SQL table. After a selection from the ddl, a datagrid is suppose to come up pertaining to the information selected, but I keep getting a...
2
by: Iams | last post by:
When your program gets an error, is there a name of that Exception somewhere on that error page so that you can trap it with the correct exception name? For instance, I errored when attempting to...
13
by: dbuchanan | last post by:
Hello, Here is the error message; ---------------------------- Exception Message: ForeignKeyConstraint Lkp_tbl040Cmpt_lkp302SensorType requires the child key values (5) to exist in the...
12
by: Lennart Anderson | last post by:
I'm having a MySQl table wih a lot of information. I want to present some main fields in a table on one page. Each record do, of course, have a unique ID. The presnted table will have one field as...
0
by: TG | last post by:
Hi! Once again I have hit a brick wall here. I have a combobox in which the user types the server name and then clicks on button 'CONNECT' to populate the next combobox which contains all the...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.