Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6124437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:07:58+00:00 2026-05-23T16:07:58+00:00

I have a little app that connects to an Oracle database that stores course

  • 0

I have a little app that connects to an Oracle database that stores course completions for a training class. The database has employee names, employee numbers, date the course was completed, and the name of the course. I have code that returns one row, shown below:

            String strPerIdNo = textBox1.Text;
            String strQuery = "PER_ID_NO = " + "'" + strPerIdNo + "'";
            DataRow[] foundRows;
            foundRows = dataSet1.DataTable1.Select(strQuery);

The row contains an array of 5 elements:

  • [0] – System.DateTime object
  • [1] – String object
  • [2] – Int object
  • [3] – String object
  • [4] – String object

I want to instantiate a DateTime object from the DateTime object in the array at [0], but I cannot figure out how. I want to display a message that contains the emp name and date they completed the course.

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:07:59+00:00Added an answer on May 23, 2026 at 4:07 pm

    Okay, first, you’re not instantiating anything here, because the DateTime you want already exists (or else, it wouldn’t be in the DataRow!). In addition, DateTime is a value type, not a reference type; it’s not normal to think of instantiating a value type; you just initialize or copy them.

    What you are looking for is to get the value of the DateTime element in your DataRow. Here are the steps:

    //step 0: make sure there's at least one DataRow in your results
    if (foundRows.Length < 1) { /* handle it */ }
    
    //step 1: get the first DataRow in your results, since you're sure there's one
    DataRow row = foundRows[0];
    
    //step 2: get the DateTime out of there
    object possibleDate = row["TheNameOfTheDateColumn"];
    
    //step 3: deal with what happens if it's null in the database
    if (possibleDate == DBNull.Value) { /* handle it */ }
    
    //step 4: possibleDate isn't a DateTime - let's turn it into one.
    DateTime date = (DateTime)possibleDate;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a little app up that has both CCLayer view and UIView. That
I am building a little app that has to communicate with a MongoDB database.
I have a little app that have by default youtube as homepage. You can
I have a little iOS5 app that shows images. I click on the image
I have a little one-liner in my Rails app that returns a range of
I am learning flex and have written a little app with a TextArea that
I am developing a web app that connects to a SQL 2000 database. Everything
I have an app that connects and updates a users facebook status. I have
I have a little php/mysql app I put together that takes an input form
So I have a little app I am working on that scrapes comics from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.