Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / June 2006

Tip: Looking for answers? Try searching our database.

Classes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kuhrty - 15 Jun 2006 22:48 GMT
Hello,

I have created a business class to separate the logic between the UI
and code.  I have loaded a dataset called dept.  Dept has a few columns
called dept, dept desc, family.  I load only department in a drop down
box.

Later on the user get to choose the department and it load the data.  I
am trying to create a method that with the drop down box changes it
grabs the department name from the data set.  Do I need to
re-instantiate the class in order to run a filter on the dataset for
this information and set it using property.

I am new to alot of this and struggling.  I may be proceeding the wrong
way but any advice for code would be helpful
Kevin Spencer - 16 Jun 2006 00:11 GMT
Hi kuhrty,

A DataSet is a disconnected copy of data in one or more result sets, tables,
views, etc., in a database. So, you are not going to be dealing directly
with the DataSet for the most part, but with a single table in it. You can
set the DataSource property of a ComboBox Control to a DataSet, a DataTable,
a DataView, or even an Array. If you set it to a DataTable or a DataView,
for example, you can use the DisplayMember to determine which Column is
displayed, and the DataMember to determine which column contains the actual
Value you want to use.

You can then get the record you want by either the Value of the
SelectedItem, or by its index in the Items Collection of the ComboBox. There
is no need to reinstantiate any class, as the class will remain around as
long as you choose to allow it to.

Signature

HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

A lifetime is made up of
Lots of short moments.

> Hello,
>
[quoted text clipped - 11 lines]
> I am new to alot of this and struggling.  I may be proceeding the wrong
> way but any advice for code would be helpful

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.