[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

formatting a column from result set

Posted on 2006-05-08
1
Medium Priority
?
210 Views
Last Modified: 2010-04-16
SqlDataReader runInfo = oCM.ExecuteReader(CommandBehavior.CloseConnection);
...
...
runInfo["checkdate"]



I want to make sure this displays as yyyyMMdd


(It is a DateTime field in a SQL Server table.)
0
Comment
Question by:Tom Knowlton
1 Comment
 
LVL 15

Accepted Solution

by:
Thogek earned 2000 total points
ID: 16635047
Perhaps something like...

    DateTime checkDate = (DateTime)runInfo["checkdate"];
    string checkDateText = checkDate.ToString("yyyyMMdd");
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses
Course of the Month18 days, 17 hours left to enroll

834 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