Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 321
  • Last Modified:

sql2005 for xml raw sending untyped data to asp.net

i have sql that uses FOR XM RAW to generate xml for my asp.net application to use to bind grids to and things like this.

the problem is that the date data is not taking the gridView formatting of the date because (and im taking a crack at this) the date value in the xml is a string and the formatting is not taking.

any thoughts on how to get this to work?

i like using xml because i can persists it to a log table and trace all the xml sent in and out. i would hate to loose this...
0
realcoding
Asked:
realcoding
1 Solution
 
SrinathKomirishettyCommented:
Try this:
1.  Format the column within the rowdatabound event
DateTime d;  
int cellNo=2;
 if (DateTime.TryParse(e.Row.Cells(cellNo).Text,out d)) {  
     e.Row.Cells(cellNo).Text = d.ToString("MM/dd/yyyy");  
or
2. Label.Text='<%# Eval("DateField", "{0:M-dd-yyyy}") %>'
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now