Accessing data in DataSet

K

KavvY

The following code produces the error, "cannot implicitly convert type
object to type string"


int intRetNo = Convert.ToInt32(tbxReturnNo.Text);

lblOutput.Text = (intRetNo.ToString());

lblOutput.Visible = true;

DataRow fRow =
dsGoodsReturned1.Goods_Returned.FindByComplaint_number(intRetNo);

// line below produces same error

// lblOutput.Text =
dsGoodsReturned1.Tables["Goods_Returned"].Rows[intRetNo]["ProductID"];

// this line produces error

lblOutput.Text = fRow["ProductID"];



How can I access the data in the Dataset? It seems to be getting to the
correct row but actually getting the data out of it is proving to be
difficult1



Cheers

rich.
 
C

Cindy Winegarden

In [email protected],
KavvY said:
The following code produces the error, "cannot implicitly convert type
object to type string"
// line below produces same error

// lblOutput.Text =
dsGoodsReturned1.Tables["Goods_Returned"].Rows[intRetNo]["ProductID"];

// this line produces error

lblOutput.Text = fRow["ProductID"];

Hi Rich,

Does the CType() function help?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top