MCQs Test!! VB Basic Test !! Essentials of VB !! Creating User Services !! function !! Anatomy !! GK March-2019 !! DATA TYPES IN JAVA !! Classes ,Constructor ,Methods,Inheritance !! Ecology-I !! Biology 2019 !! Gk april 2019 !! Biology (living world) !! Plant anatomy !! CELL STRUCTURES AND FUNCTION !! General biology !! Human physiology !! Data structure !! Ecology-II !! GK TEST !! Reproduction in plants !! Human reproduction !! The ABC of C !! Operating system set1 !! Operating system set2 !! Gk and current affairs !! Animal kingdom !! Number system !! Animal kingdom-II !! Gk TEST-III !! Number series !! Microorganisms !! Interview question in c !! Time and Work !! Percentage !! General history !! Average !! Cells !! Locomotion and Movement !! paging !! Bacteriology !! Page replacement policy !! Secondary memory and Disk scheduling !! Introduction of Nervous System and neurons !! Plant harmones !! Transport and Mineral Nutrition in Plants !! Neurotransmitters !! Modern Indian History !! Photosynthesis in Plants !! Modern Indian History-II !! Plant respiration !! Environment & Biodiversity !! Environment & Biodiversity - II !! Algae, Bryophytes, Pteridophytes !! Area !! Cricket !! Days of the Year (India and the World) !! Plant Pathology - I !! Indian Transport System !! Plant Pathology - II !! Aptitude !! Biology !! Botany !! C language !! Computer Science !! Core Java !! Gate !! GK !! Mysql !! Operating system !! Physics !! VB-Visual Basic !! Zoology


ADO.NET Projects

ADO.NET Project 1

ADO.NET Examples


Binding Data to Controls
Previous Home Next

Simple data binding is the ability to bind a control to a single data element. When you need to display and manipulate more than one data element at a time,then this is called complex data binding.Complex data binding is the ability to bind a control to more than one data element and more than one record in a database.

Class Hierarchies Relevant to Data Binding

//Text box controls—Used to display, or accept as input, 
//a single line of text.Can also support multilines.
System.Windows.Forms.TextBox class
System.Windows.Forms.DataGridTextBox subclass
System.Web.UI.WebControls.Textbox class
//List controls—Enable you to display a list of items to 
//the user that the user can select by clicking.
System.Windows.Forms.ListControl class
System.Windows.Forms.ComboBox subclass
System.Windows.Forms.ListBox subclass
System.Web.UI.WebControls.ListControls class
System.Web.UI.WebControls.CheckBoxList subclass
System.Web.UI.WebControls.DropDownList subclass
System.Web.UI.WebControls.ListBox subclass
System.Web.UI.WebControls.RadioButtonList subclass
//DataGrid controls—Used to display data in a 
//scrollable, tabular grid.
System.Windows.Forms.DataGrid class
System.Web.UI.WebControls.DataGrid class


Methods Binding

For ListBox controls, you can bind the control to a DataSet class using the DataSource and DisplayMember properties as you have seen in our Windows Forms example:

ListBox1.DataSource = customer
ListBox1.DisplayMember = "Customers.CompanyName"

Or, you can use the DataBinding method programmatically to achieve the same results.

ListBox1.DataBindings.Add(New System.Windows.Forms.Binding
("SelectedItem", customer, "Customers.CompanyName"))

For DataGrid controls, you bind the control to a DataSet class using the DataSource and DataMember properties:

DataGrid1.DataMember = "Customers.CustomersOrders"
DataGrid1.DataSource = customer

Or, use the SetDataBinding method programmatically to achieve the same results:

Previous Home Next