Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools

Dynamically bind a DataList or DataCombo control to an ADO Recordset

Total Hit ( 3996)

Rate this article:     Poor     Excellent 

 Submit Your Question/Comment about this article

Rating


 


When dynamically changing the bound ADORecordset for a DataCombo or DataList control, the order you follow when assigning the properties is important. This is the correct sequence of operations to perform to change the bound recordset for these controls:

Click here to copy the following block
' unbind the current sources
Set DataCombo1.DataSource = Nothing
Set DataCombo1.RowSource = Nothing

' set the new binding - start with the string properties
DataCombo1.DataField = "ProductID"  ' the bound field in master table
DataCombo1.BoundColumn = "ID"     ' the bound field in detail table
DataCombo1.ListField = "ProductName" ' the display field in detail table
Set DataCombo1.RowSource = rsProducts ' the detail table
Set DataCombo1.DataSource = rsOrder  ' the master table


Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.