dataset

  • Thread starter Thread starter chris
  • Start date Start date
C

chris

Hi There,

How can I extract a DataSet? I recieve the dataset from a
server. I created a DataTable like this:


DataSet ds = remoteInterface.retrieveUser(userBankId);
DataTable dtBankStuff = ds.Tables["Customers"];


is this the right way?

I would like to extract only the columns to textboxes,
since I will only receive one row.

I tried this:


textBox15.Text = dtBankStuff.Columns[0].ToString();


but it doesn't work. Has anyone please a suggestion?

Thanks a lot

Chris
 
Hi Chris!

If all you want to do is to get one column from the dataset then you could
do it this way.

DataSet ds = remoteInterface.retrieveUser(userBankId);

textBox15.Text = ds.Tables["Customers"].Rows[0]["ColumnName"].ToString();

//you can replace ColumnName with the index of the column like this
textBox15.Text = ds.Tables["Customers"].Rows[0][0].ToString();

I hope this helps you out.

//Mikael
 
Back
Top