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 / Languages / Managed C++ / December 2003

Tip: Looking for answers? Try searching our database.

Populating a Combo box using a SqlDataReader

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Neil Guyette - 10 Dec 2003 00:08 GMT
Hello, Everyone,

I'm trying to find information on how to populate a combo
box using a SqlDataReader.  I want to be able to set the
value of the combo's value property different then the
combo's text property (what the user will see).  Is this
possible with a SqlDataReader?

Thanks

-Neil
Gary Chang - 10 Dec 2003 08:59 GMT
Hi Neil,

Thanks for posting in the group!

SqlDataReader provides a means of reading a forward-only stream of rows
from a SQL Server database(similar to a cached read-only recordset).

>populate a combo box using a SqlDataReader,
If you have a valid SqlDataReader, you can manually retrieve data from that
SqlDataReader to populate a combo box.(no automatic way)

The following is a VC++ SqlDataReader sample program link:
http://samples.gotdotnet.com/quickstart/util/srcview.aspx?lbLangPref=CP&path
=/quickstart/howto/samples/adoplus/sqldtreader/sqldtreader.src

Best regards,
Gary Chang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
| Content-Class: urn:content-classes:message
| From: "Neil Guyette" <nguyette@gemssensors.com>
[quoted text clipped - 27 lines]
|
| -Neil
Neil Guyette - 10 Dec 2003 13:19 GMT
Mr. Chang,

Thanks for your reply.

I realized that the SqlDataReader is forward only, but
when coding an asp.net page and using a dropdownbox you
can bind it to a SqlDataReader.  I found my solution last
night, instead of using  a SqlDataReader I'm now using a
SqlDataAdapter. Using the SqlDataAdapter to fill a
DataSet object.

Once again thanks a lot.

Neil Guyette

>-----Original Message-----
>Hi Neil,
[quoted text clipped - 53 lines]
>
>.
Gary Chang - 11 Dec 2003 01:11 GMT
Hi Neil,

Thanks for your quickly response!

We are very delightful to know you have found your resolution.

Thanks again for participating the community.

Best regards,
Gary Chang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

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.