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

  • Home
  • SEARCH
  • 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 7851225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:06:55+00:00 2026-06-02T19:06:55+00:00

I have searched and found surprisingly few results. I found that there is some

  • 0

I have searched and found surprisingly few results. I found that there is some datatype property for DataColums, but when retrieving data from a SQL server database, what is the datatype of whatever is retrieved? I’m working with a SqlDataAdapter to fill a DataTable. To get the values, I work as follows:

DataTable dtt = Database.get(SQLString); //pseudo-code
string value = dtt.Rows[0][0]; //Or is this a string?

So what is in dtt.Rows[0][0] if the database column datatype is bigint, int, date or bit?
Do I need to convert them to string first and then convert them to other datatypes I require?

  • 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-06-02T19:06:57+00:00Added an answer on June 2, 2026 at 7:06 pm

    Well it depends how is defined in database, for example let’s say that you have this table :

    CREATE TABLE [dbo].[Test](
        [ID] [int] NOT NULL,
        [Name] [nvarchar](128) NOT NULL,
        [Birthday] [datetime]) 
    

    then you can access first row like that :

    DataTable dtt = Database.get("Select * from Test"); //pseudo-code
    DataRow rw = dtt.Rows[0];
    int id = rw.Field<int>("ID");
    string name = rw.Field<string>("Name");
    DateTime dt = rw.Field<DateTime>("Birthday");
    

    or

    DataTable dtt = Database.get("Select * from Test"); //pseudo-code
    int id = (int) dtt[0]["ID"];
    string name = (string) dtt[0]["Name"];
    DateTime dt = (DateTime) dtt[0]["Birthday")];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have searched and found a lot of different things but none that actually
i have searched Xcode controls but doesn't found anything that makes a GridView like
I have searched around and found some tutorials for xsl:key and key() function, but
I have searched and found a few image scaling libraries for Java. But not
I have searched and found some info on this topic but the answers are
I have searched and found that in cordova.plist we need to add a row
I have searched and found another with quite close question but the result was
I have searched but have not found my answer. Disclaimer: I am brand new
I have searched for a CGI and read about it but nothing useful found.
I have searched online but all the answers I have found were very primitive.

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.