I am extremely new to programming and Visual Basic.
I want to know how to read data from an SQL database and assign it to a variable.
For example if I have a database with three columns (like below)
First Name | Last Name | Age
Ebrahim | E | 26
Sam | Menodza | 24
Sean | Steven | 54
and I want to assign Sean's age to a variable called sAge notwithstanding that I would first have to check/query the First Name columns for the value of "Sean".
What code would I use to accomplish all of this (querying first column/ assigning variable sAge to requested value)? Could you give me a complete code if possible (ie include Connection Strings codes if necessary).-please.
Thanking you very much in advanced
P.S: I would like the code to be in VB
I want to know how to read data from an SQL database and assign it to a variable.
For example if I have a database with three columns (like below)
First Name | Last Name | Age
Ebrahim | E | 26
Sam | Menodza | 24
Sean | Steven | 54
and I want to assign Sean's age to a variable called sAge notwithstanding that I would first have to check/query the First Name columns for the value of "Sean".
What code would I use to accomplish all of this (querying first column/ assigning variable sAge to requested value)? Could you give me a complete code if possible (ie include Connection Strings codes if necessary).-please.
Thanking you very much in advanced
P.S: I would like the code to be in VB
Comment