Solved

Fill data into the default table of Typed DataSet!

Posted on 2004-09-15
6
190 Views
Last Modified: 2010-04-15
Assume we have a typed DataSet called CExchange_RateList of table Exchange_Rate in the database. This typed dataset has a default table Exchange_Rate.
So how can I fill this table with the result of the command "Select * from Exchange_Rate". It means that the table CExchange_Rate.Exchange_Rate will contain the result of the command "Select * from Exchange_Rate"
Thank you very much!
0
Comment
Question by:tinh911
  • 2
6 Comments
 
LVL 10

Accepted Solution

by:
123654789987 earned 125 total points
ID: 12071924

  CExchange_RateList = command.ExecuteDataset();

Now  CExchange_RateList.Tables[0] that is the table Exchange_Rate will contain the result of the select statement
0
 
LVL 8

Assisted Solution

by:gregasm
gregasm earned 125 total points
ID: 12071933
this is what i would do

DataAdapter da = new DataAdapter();
da.SelectCommand = command;

da.Fill(dataSet.Tables["Exchange_Rate"]);

//or

da.Fill(dataSet.Tables[0]);

the key would be to set the SelectCommand property of a dataadapter and use that.
I dunno, 123454354's suggestion probably works too, but this is what I would do and variety is the spice of life =]]
0
 
LVL 8

Expert Comment

by:gregasm
ID: 12366153
The question is quite straightforward.

I can't vouch for  123654789987's solution, but I know mine works.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now