-
data binding with ComboBox ( DropDown List Box )
Hi
I have a simple question . I need to bind data to two drop down list box . I have two drop down list box ( Dropdownlist1 & Dropdownlist2 ) which need be populated by two XML file ( XML1 & XML2 ) . The data coming out of SQL server database in XML format . I have to populate the first drop down box and based on the value user choose I have to populate the second drop down box with second box . How to do that . Please help . Hete is my code
artial Class WebUserControl
Inherits System.Web.UI.UserControl
Private connectionstring As String ''= webConfigurationManager.ConnectionString("MDMORT").ConnectionString
Public Shared dsConfigarator As New DataSet
Private Sub binddata()
' Closed for testing by kaushik
If Not Me.IsPostBack Then
Dim con As New SqlConnection(connectionstring)
'Dim selectSQL As String = ("")
' Dim cmd As New SqlCommand(selectSQL, con)
DropDownList1.DataSource = dsConfigarator.Tables(0)
DropDownList1.DataTextField = "SABLE_PROD_GRP"
DropDownList1.DataValueField = "PROD_FAMILY_DESC"
dsConfigarator.ReadXml("C:\XML1")
DropDownList1.DataBind()
'con.Close()
DropDownList1.SelectedIndex = -1
End If
End Sub
Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
binddata()
End Sub
End Class
Similar Threads
-
By abenitez77 in forum VB Classic
Replies: 1
Last Post: 02-06-2006, 02:56 AM
-
By Christian in forum .NET
Replies: 0
Last Post: 01-24-2002, 03:53 PM
-
By Sean gallaghar in forum ASP.NET
Replies: 1
Last Post: 11-23-2000, 06:58 AM
-
By Gots in forum VB Classic
Replies: 0
Last Post: 10-14-2000, 11:12 AM
-
By Chris cherryholmes in forum VB Classic
Replies: 1
Last Post: 07-09-2000, 12:47 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks