Data Access using SqlDataAdapter

G

Guest

In the below listed code, instead of using GetValue(2), is there any way to
retrieve fields by calling the field name itself? (for example
GetValue("str_mail_from") ?????)

========================================================myda = new
SqlDataAdapter ("SELECT lng_id,lng_clientid,str_mail_from FROM
web_tbl_emails", mycn);

ds = new DataSet();
myda.Fill (ds,"Table");

foreach(DataRow row in ds.Tables [0].Rows )
{
string test= row.ItemArray.GetValue(2)
}
========================================================
 

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