Q: data in dataset

G

Guest

I populate DS and trying to reach each field value,
sqlConn.Open();
DA.Fill(DS);
sqlConn.Close();

// populate textbox
string myField = DS.Tables[0].Rows["myField"].ToString();
tbMyField.text= myField;


DS.Tables[0].Rows["myField"].ToString() does not work. How would you do this?
Thanks,
Jim.
 
E

Eliyahu Goldin

If you want to read from the first row:

DS.Tables[0].Rows[0]["myField"].ToString();

Did you consider typed datasets?

Eliyahu
 

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

Top