can i bind a text field to a dataview table field VB.net
Posted on 2004-09-22
I have a form that has three text fields, a combobox and datagrid. I have a one to many relationship with the form and the datagrid. the combobox is used to let the user choice which record they want to look at. I havetwo data Adapters, one for each table. A dataset and a relationship, and two dataviews. I am using the rowFilter to populate two dataviews.
Dataview1 is bound to the datagrid. this is good
Can i bound Datagrid2 to the text Fields on my form?
Here is the code that i am trying to use, i get ti error,
Class "System.data.datatable" ca not be indexed because it has no default property
Dim strLocation As String
'bind the data in the database to the textfields in the form, this doesn't work
Me.txtAccessID.DataBindings.Add("text", DvTextFields.Table("Accessorie"), "Accessorie_ID")
Me.rtxtDesc.DataBindings.Add("text", DvTextFields.Table("Accessorie"), "Access_Desc")
Me.cboAccessType.DataBindings.Add("text", DvTextFields.Table("Accessorie"), "Access_Type")
Me.txtPrice.DataBindings.Add("text", DvTextFields.Table("Accessorie"), "R_List_Price")
'bind the datagrid to te view, this works
Me.dgrModels.DataSource = DvDatagrid
Catch ex As Exception