databinding. objectives list and explain the types of binding. explain binding context and...
TRANSCRIPT
![Page 1: DataBinding. Objectives List and explain the types of binding. Explain Binding Context and CurrencyManager class. List and explain the properties and](https://reader035.vdocument.in/reader035/viewer/2022062409/5697bfbc1a28abf838ca18d9/html5/thumbnails/1.jpg)
DataBinding
![Page 2: DataBinding. Objectives List and explain the types of binding. Explain Binding Context and CurrencyManager class. List and explain the properties and](https://reader035.vdocument.in/reader035/viewer/2022062409/5697bfbc1a28abf838ca18d9/html5/thumbnails/2.jpg)
Objectives
List and explain the types of binding.
Explain Binding Context and CurrencyManager class.
List and explain the properties and methods of Binding Source class.
Explain briefly the Sort property of the BindingSource class
![Page 3: DataBinding. Objectives List and explain the types of binding. Explain Binding Context and CurrencyManager class. List and explain the properties and](https://reader035.vdocument.in/reader035/viewer/2022062409/5697bfbc1a28abf838ca18d9/html5/thumbnails/3.jpg)
DataBinding
DataBinding is one of the most powerful features of .NET and Windows Forms. It help in linking a control to a data source tables in the database. This is useful to view, insert, update, and delete records in the table.
![Page 4: DataBinding. Objectives List and explain the types of binding. Explain Binding Context and CurrencyManager class. List and explain the properties and](https://reader035.vdocument.in/reader035/viewer/2022062409/5697bfbc1a28abf838ca18d9/html5/thumbnails/4.jpg)
DataBinding
Allows you to create a link between the controls of the form and the database Once the controls are linked to the database , you can retrieve data from the database.
![Page 5: DataBinding. Objectives List and explain the types of binding. Explain Binding Context and CurrencyManager class. List and explain the properties and](https://reader035.vdocument.in/reader035/viewer/2022062409/5697bfbc1a28abf838ca18d9/html5/thumbnails/5.jpg)
Data binding
![Page 6: DataBinding. Objectives List and explain the types of binding. Explain Binding Context and CurrencyManager class. List and explain the properties and](https://reader035.vdocument.in/reader035/viewer/2022062409/5697bfbc1a28abf838ca18d9/html5/thumbnails/6.jpg)
Data Provider
Data Source
Consumer
Database
![Page 7: DataBinding. Objectives List and explain the types of binding. Explain Binding Context and CurrencyManager class. List and explain the properties and](https://reader035.vdocument.in/reader035/viewer/2022062409/5697bfbc1a28abf838ca18d9/html5/thumbnails/7.jpg)
BindingContext class
BindingContext class is used to handle the BindingManagerBase objects. Windows Form contains at leats one BindingContext Object
Properties
IsReadOnly
Item
Methods
Add
Contains
Remove
UpdateBinding
txtEmpNo.DataBindings.Add("Text" , ds.Tables["Employee"] , "EmpNo")
![Page 8: DataBinding. Objectives List and explain the types of binding. Explain Binding Context and CurrencyManager class. List and explain the properties and](https://reader035.vdocument.in/reader035/viewer/2022062409/5697bfbc1a28abf838ca18d9/html5/thumbnails/8.jpg)
CurrencyManager class
A control which is bound to a data source is associated with a CurrencyManager.
Property Methods Events
Binding CheckEmpty
Count OnPositionChanged
Current OnItemChanged ItemChanged
List AddNew PositionChanged
Position Refresh ListChanged
RemoveAt
ResumeBinding
CurrencyManager bmOrders = (CurrencyManager)this.BindingContext[ds.Tables["Employee"]];bmOrders.Position+=1;
![Page 9: DataBinding. Objectives List and explain the types of binding. Explain Binding Context and CurrencyManager class. List and explain the properties and](https://reader035.vdocument.in/reader035/viewer/2022062409/5697bfbc1a28abf838ca18d9/html5/thumbnails/9.jpg)
Types of Binding
Simple Binding : a property of a control is bound to a single value Ex : TextBox with a column in table
Complex Binding : a control is associated with one or more data values Can only be done on controls, which display more than one value at a time Ex : comboBox
![Page 10: DataBinding. Objectives List and explain the types of binding. Explain Binding Context and CurrencyManager class. List and explain the properties and](https://reader035.vdocument.in/reader035/viewer/2022062409/5697bfbc1a28abf838ca18d9/html5/thumbnails/10.jpg)
Simple Data binding
![Page 11: DataBinding. Objectives List and explain the types of binding. Explain Binding Context and CurrencyManager class. List and explain the properties and](https://reader035.vdocument.in/reader035/viewer/2022062409/5697bfbc1a28abf838ca18d9/html5/thumbnails/11.jpg)
Complex data binding
![Page 12: DataBinding. Objectives List and explain the types of binding. Explain Binding Context and CurrencyManager class. List and explain the properties and](https://reader035.vdocument.in/reader035/viewer/2022062409/5697bfbc1a28abf838ca18d9/html5/thumbnails/12.jpg)
Binding class
Properties Methods Events
BindAbleComponent ReadValue BindingComplete
BindingManagerBase WriteValue
Control
Datasource
![Page 13: DataBinding. Objectives List and explain the types of binding. Explain Binding Context and CurrencyManager class. List and explain the properties and](https://reader035.vdocument.in/reader035/viewer/2022062409/5697bfbc1a28abf838ca18d9/html5/thumbnails/13.jpg)
BindingSource component
Acts as a strongly typed data source Binding the controls and data indirectly Support data navigation , manipulation and sorting or filtering data
![Page 14: DataBinding. Objectives List and explain the types of binding. Explain Binding Context and CurrencyManager class. List and explain the properties and](https://reader035.vdocument.in/reader035/viewer/2022062409/5697bfbc1a28abf838ca18d9/html5/thumbnails/14.jpg)
BindingSource
![Page 15: DataBinding. Objectives List and explain the types of binding. Explain Binding Context and CurrencyManager class. List and explain the properties and](https://reader035.vdocument.in/reader035/viewer/2022062409/5697bfbc1a28abf838ca18d9/html5/thumbnails/15.jpg)
Binding a control
You can bind a control to a data source at desing time or run time.
![Page 16: DataBinding. Objectives List and explain the types of binding. Explain Binding Context and CurrencyManager class. List and explain the properties and](https://reader035.vdocument.in/reader035/viewer/2022062409/5697bfbc1a28abf838ca18d9/html5/thumbnails/16.jpg)
Sort property of BindingSource
![Page 17: DataBinding. Objectives List and explain the types of binding. Explain Binding Context and CurrencyManager class. List and explain the properties and](https://reader035.vdocument.in/reader035/viewer/2022062409/5697bfbc1a28abf838ca18d9/html5/thumbnails/17.jpg)
Filter property
- Filter property of the BindingSource class is used for filtering dataEx : bClass.Filter = “Address=‘California’”
![Page 18: DataBinding. Objectives List and explain the types of binding. Explain Binding Context and CurrencyManager class. List and explain the properties and](https://reader035.vdocument.in/reader035/viewer/2022062409/5697bfbc1a28abf838ca18d9/html5/thumbnails/18.jpg)
Summary
![Page 19: DataBinding. Objectives List and explain the types of binding. Explain Binding Context and CurrencyManager class. List and explain the properties and](https://reader035.vdocument.in/reader035/viewer/2022062409/5697bfbc1a28abf838ca18d9/html5/thumbnails/19.jpg)
Summary