dataset

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • chris

    #1

    dataset

    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(u serBankId);
    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.Col umns[0].ToString();


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

    Thanks a lot

    Chris


  • Mikael Gustavsson

    #2
    Re: dataset

    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(u serBankId);

    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

    "chris" <chriscoelle@ho tmail.com> wrote in message
    news:0f0901c36b d5$10dc3960$a10 1280a@phx.gbl.. .[color=blue]
    > 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(u serBankId);
    > 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.Col umns[0].ToString();
    >
    >
    > but it doesn't work. Has anyone please a suggestion?
    >
    > Thanks a lot
    >
    > Chris
    >
    >[/color]


    Comment

    Working...