Solved

sql2005 for xml raw sending untyped data to asp.net

Posted on 2010-09-01
1
281 Views
Last Modified: 2012-05-10
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
Comment
Question by:realcoding
1 Comment
 
LVL 2

Accepted Solution

by:
SrinathKomirishetty earned 500 total points
ID: 33583734
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question