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 7785017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:11:17+00:00 2026-06-01T20:11:17+00:00

I have a labels that need values retreieved from a Database. I am able

  • 0

I have a labels that need values retreieved from a Database.

I am able to query the database but how can I extract values from a DataTable and place them in the appropiate labels

Thanks

  • 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-01T20:11:18+00:00Added an answer on June 1, 2026 at 8:11 pm

    In DataTable you have rows and columns. To select a particular cell you need to do this:

    label1.Text = dataTable[0][0];
    

    This will set the label1 text to Row 0, Column 0 value.

    To iterate through each row use:

    foreach(DataRow row in dataTable.Rows)
    {
    Console.WriteLine(row["ColumnName1"]);
    Console.WriteLine(row["ColumnName2"]);
    Console.WriteLine(row["ColumnName3"]);
    Console.WriteLine(row["ColumnName4"]);
    }
    

    This will print values for columns against each row. In this code you need to replace string for columnname (e.g. ColumnName1) with your column names

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 2 labels that need to be given value from sql server db
I have a label that gets updated with values calculated from information received by
I have a loop, where I need to use the values from 2 IEnumerable's,
I have a PHP document that query's a MYSQL database based on the input
I have some labels that I want to allow users to edit. Is it
I have two labels that are stacked. If I want a horizontal line between
everyone. I have some labels that I draw them in the xib file, and
I've created a skin that allows me to have two labels on a spark
I have a HUD window that has some labels on it, and I want
I am trying to write a SQL query that pulls from 3 tables and

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.