TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Carlos Sanchez
NA
264
0
Several Tables in a DataSet
Jul 15 2004 10:54 AM
I want to know wether or not is possible having several tables in a DataSet. For example, when I want to create a DataSet I have to do the next: string commandText = "SELECT Column1, Column2 FROM Table1"; SqlDataAdapter myAdapter = new SqlDataAdapter(commandText, myConnection); DataSet myDataSet = new DataSet(); myAdapter.Fill(myDataSet, "Table1"); If I wanted to Bind the DataSet with a component (for example ComboBox) I'd do the next: ComboBox1.DataSource = myDataSet.Tables["Table1"]; ComboBox1.DisplayMember = "Column1"; So, I want to know wether I can have several tables in the same DataSet to Bind them with several components, something like this: ComboBox1.DataSource = myDataSet.Tables["Table1"]; ComboBox2.DataSource = myDataSet.Tables["Table2"]; ComboBox3.DataSource = myDataSet.Tables["Table3"]; ComboBox4.DataSource = myDataSet.Tables["Table4"]; is this possible??? How can I do it??? if you know what can I do, paste some code please. thanks in advance.
Reply
Answers (
4
)
How to import Excel to DataSet with C#(windows application)
get year,month,day,hour...