Solved

Fill data into the default table of Typed DataSet!

Posted on 2004-09-15
6
212 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

813 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

17 Experts available now in Live!

Get 1:1 Help Now