2 Replies - 1774 Views - Last Post: 10 April 2013 - 12:59 PM Rate Topic: -----

#1 BarNunBoi  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 232
  • Joined: 28-March 12

A field or property with the name 'DueDate' was not found on t

Posted 05 April 2013 - 08:02 AM

I am trying to upkeep an legacy application wrote with ASP.NET 1.1, and I keep getting this error when trying to click on export spreadsheet function (A field or property with the name 'DueDate' was not found on the selected datasource.) I have looked at the code for a whole day now and can't seem to find the problem. I have tried to change some code, I have looked in the db table and found that particular field doesn't even exist. There is no Stored Procedure. Furthermore, the field that I need to export is called due. I tried to change to the code so that it queries the "due" field, but I still get the error. Maybe a new set of eyeballs can see what I'm missing. Here is some of my code from the apsx page.

<radg:GridBoundColumn HeaderText="Due Date" DataFormatString="{0:d}" SortDescImageUrl="~/RadControls/Grid/Skins/WebGray/SortDesc.gif"
							DataField="due" SortAscImageUrl="~/RadControls/Grid/Skins/WebGray/SortAsc.gif" FilterImageUrl="~/RadControls/Grid/Skins/WebGray/Filter.gif"
							UniqueName="due" SortExpression="due"></radg:GridBoundColumn>


Now as you can see the DataField is set to "due".

Here is a little code behind.
dgColumn = New BoundColumn
        dgColumn.HeaderText = "Due Date"
        dgColumn.DataField = "due"
        dgColumn.DataFormatString = "{0:d}"
        dg.Columns.Add(dgColumn)


This is part of some code that generates columns for the datagrid to export.

Last but not least here is the Select statement.
strSQL = "SELECT status, state, comments, due, received, signature FROM AnnualReturns WHERE RegionCode=" & XXXXXXX & " " & "AND" & " " & SearchColumn & " " & "LIKE" & "'%" & txtSearchTerm & "%'" & " " & " " & "ORDER BY State"



These are the only places in app where due/duedate is coded.Is there something I am missing here. Any input would greatly appreciate it. Thanks!!

This post has been edited by BarNunBoi: 05 April 2013 - 08:06 AM


Is This A Good Question/Topic? 0
  • +

Replies To: A field or property with the name 'DueDate' was not found on t

#2 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1052
  • View blog
  • Posts: 4,077
  • Joined: 02-July 08

Re: A field or property with the name 'DueDate' was not found on t

Posted 06 April 2013 - 07:12 AM

A screenshot of the table with column names would be helpful. In your Select string you look like your trying to pass a textbox to the Like statement instead of it's .Text? I would also highly advise to move to Parameterized Queries - since your current query is open to SQL injection.
Was This Post Helpful? 0
  • +
  • -

#3 BarNunBoi  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 232
  • Joined: 28-March 12

Re: A field or property with the name 'DueDate' was not found on t

Posted 10 April 2013 - 12:59 PM

I fixed my problem. I had to recompile my site, and change my bin files on my server. Thanks for your help HAWK!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1