Retrieve rows based on column names
Posted by: swetha muthineni
Date: September 20, 2010 11:15PM

I have a employee table "emp" described as,

Emp_Id varchar()
First_name varchar()
Last_name varchar()

I want to retrieve values of first_name and last_name with respect to emp_id.

I have written a query as,

dim str as string=Select first_name,last_name from emp where emp_id='H1';
dim ds as new dataset
dim da as new mysqldataadapter(str,con)
da.fill(ds,"emp")

Dim Fn,Ln as string,

Fn=ds.tables(0).rows(0)(0)
Ln=ds.tables(0).rows(0)(1)

I am getting the output perfectly, but i need to assign the values to FN,Ln not using the row & column index. I want to retrieve using column names.. Is it possible?

Options: ReplyQuote


Subject
Written By
Posted
Retrieve rows based on column names
September 20, 2010 11:15PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.