Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > VS.NET 2002/2003
|
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 5th, 2006, 05:04 AM
Registered User
 
Join Date: Mar 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Transfer Sql data into combobox list vb.net

I want to bring/display the sql data from one column to combobox as a drop downdown list in vb.net. Hoe do i do that?

Dim strSQL As String = "SELECT * FROM RegionSiteCampus"
        Dim SqlComm As New System.Data.SqlClient.SqlCommand(strSQL, conn)
        Dim DR As System.Data.SqlClient.SqlDataReader
        conn.Open()
             DR = SqlComm.ExecuteReader
             Do While DR.Read()
                Combo_Region.Items.Add(DR.Item("Region"))
                Combo_Site.Items.Add(DR.Item("Site"))

Any suggestions for better way to do it? I want the items in each column not to be repeated.


Thank you






Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Encryption in VB.Net and SQL Server malik_naveed101 ASP.NET 1.0 and 1.1 Professional 0 May 9th, 2008 11:45 PM
Data Bind ComboBox to display the List Bjay Pro VB Databases 0 July 29th, 2007 02:57 PM
Inserting data using VB.net and sql express saif44 Visual Basic 2005 Basics 6 June 18th, 2007 08:23 PM
Data List in vb.net mistry_bhavin General .NET 0 August 6th, 2004 11:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.