View Single Post
  #9 (permalink)  
Old September 3rd, 2009, 05:33 PM
skhan skhan is offline
Authorized User
Join Date: Jun 2009
Posts: 66
Thanks: 22
Thanked 0 Times in 0 Posts

I had to do that stupid thing cause when I tried to do like the following:
DateTime dd=r["First_Resurvey_Date"];

It gave me the following error:
'System.Data.DataColumn.DataType' denotes a 'property' where a 'method' was expected

The only methods associated with r["First_Resurvey_Date"] were Equals(), getHashCode(), getType() and ToString(). So to get the DateTime value from column "First_Resurvey_Date", I had to do those meaningless steps. I could be completely wrong as I have very little knowledge of ASP.NET C#. But that's what I could do.

Yes I needed code to change the display of the value from the datatable *during* the binding to the datagrid. I don't understand how should I do that, so maybe I will try out the formatting in the SQL Query. Thank you for your suggestion. And sorry for my weird/stupid questions. It's not that I am not doing proper research, I am trying my best. It's just that I don't know everything about DataGrid properties to try out.