简体   繁体   中英

How to get specific cell from table mysql to Vb.net

I need to get a specific data/cell from a table and embed it to a label.text, for example

I have a table named Student with columns of Student_No. , Student_Name , Student_Age , Year and Section . And I need to get a single data/cell from a column but the next code will get the one next to it and so on.

I got a code like this:

SELECT col_name  
  FROM table_name  
 WHERE col_name='values'  
 LIMIT 1

but it gets the first one and if I change the limit to 2 it gets two...

you should specify the id of the entry you want to get from the table

SELECT col_name 
  FROM table_name 
 WHERE col_name='values' 
       AND id = '1' LIMIT 1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM