shenn
shenn

Reputation: 889

Fill DataSet with DataTable

private static DataSet GetAuctionItemsDataSet()
{
    SqlDataAdapter adapt = new SqlDataAdapter();
    adapt = DataAdapter;
    DataSet filler = new DataSet();

    adapt.Fill(filler.Tables["AuctionItems"]);
    adapt.Fill(filler.Tables["Bids"]);

    return filler;
}

I want the the SqlDataAdapter to populate a new DataSet with records from the db. The DataSet should contain tables "AuctionItems" and "Bids" I think I am close but cannot seem to find the answer.

Upvotes: 0

Views: 18659

Answers (1)

KV Prajapati
KV Prajapati

Reputation: 94625

To populate the DataSet try following syntax,

DataSet filler = new DataSet();
adapt.Fill(filler,"AuctionItems");
adapt.Fill(filler,"Bids");

Upvotes: 4

Related Questions