Solved

sql2005 for xml raw sending untyped data to asp.net

Posted on 2010-09-01
1
260 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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

728 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now