?
Solved

dbgride question ?

Posted on 2004-04-12
8
Medium Priority
?
182 Views
Last Modified: 2010-10-05
Hi

How can I get the value of  field from the first column when I select the row

I am waiting your answers

peruzzi
0
Comment
Question by:peruzzi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
8 Comments
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10808761
If you are using a DBGrid,

 fields[0]

 if its a string or you want it as a string, fields[0].asString


Shane

 
0
 
LVL 11

Accepted Solution

by:
shaneholmes earned 120 total points
ID: 10808780
ShowMessage(DBGrid1.DataSource.DataSet.Fields[0].asString);

Shane
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10808790
OR if you know your table name

  MyTable.Fields[0].asString;

Shane
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:peruzzi
ID: 10808798
I will try it

peruzzi
0
 
LVL 17

Assisted Solution

by:mokule
mokule earned 80 total points
ID: 10808909

I would always advice getting data using its name.
In most cases it is just what are interested in.

DBGrid1.DataSource.DataSet.FieldByName('Cst_firstname').asString;
0
 

Author Comment

by:peruzzi
ID: 10809181
Hi
all what you say is true
so I  wish you will be agree with my spliting points between you

thanks my friends
0
 
LVL 17

Expert Comment

by:mokule
ID: 10809306
Hi peruzzi
Never mind points. But believe me absolutely avoid getting data by column number. I'm sure Shane will tell You the same.
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10809433
I will tell you that it is recommended that you use the FieldByName method versus the fields array. Whether or not you should "absolutely  avoid" it,  could be called into question. I have used it successfuly in the past, but I try to stay away from using it, and most always use the FieldByName.

I didn't know exactly what you were trying to achieve, and your question was little hard to understand, but when I saw "first column", i thought thats what you were looking for.

Thanks Mokule!

Shane

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month12 days, 11 hours left to enroll

777 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