alone76816
New member
- Joined
- Mar 8, 2011
- Messages
- 1
- Programming Experience
- Beginner
[FONT="]1. I have a problem as below: I have a Database, include 3 Table : TBLHocVien, TBLDiem, TBLDiemDanh, all this Table have RelationShip by Field: MaHV.[/FONT]
[FONT="]1. [/FONT][FONT="] I make a Connect with this databse, but I don’t use Command SQL, I make connect to Database by Winzard in VB.Net 2005.[/FONT]
[FONT="][/FONT]
[FONT="]I Add Row, Edit, Delete,or Update by VB.net it’s OK. But then I opened Database by Access and I add more a few Table or Field, then VB.net is nothing. So How do I add Field or Table by ways : BindingSource ? [/FONT]
[FONT="]Ex :[/FONT]
[FONT="]Me.Validate()
Me.TBLDIEMDANHBindingSource.EndEdit()
Me.TBLDIEMDANHTableAdapter.Update(Me.DatabaseDataSet.TBLDIEMDANH)[/FONT]
[FONT="]2. [/FONT][FONT="]2. The Second Problem is : when I edit DataSet in Window DataSource[/FONT]
[FONT="]
[/IMG[/URL]][/FONT]
[FONT="]And I add more a Column : TenHV Form Table TBLHocVien to Table TBLDiem by ways Query as below:[/FONT]
[FONT="]
[/IMG[/URL]][/FONT]
[FONT="]
[/IMG[/URL]][/FONT]
[FONT="]And the result on Dateset show as below:[/FONT]
[FONT="]
[/IMG[/URL]][/FONT]
[FONT="]DataGrid of table TBLDiem as below:[/FONT]
[FONT="]
[/IMG[/URL]][/FONT]
[FONT="]The result : Column TenHV on DataGrid show OK as TBLHocVien. But when I Run and I edit value Column on DataGrid. And I Update to Database, it’s nothing. I can’t. I use:[/FONT]
[FONT="]Me.Validate()
Me.TBLDIEMDANHBindingSource.EndEdit()
Me.TBLDIEMDANHTableAdapter.Update(Me.DatabaseDataSet.TBLDIEMDANH)[/FONT]
[FONT="]‘Error in line 3, Because it hasn’t Update. So How can I update to database ? [/FONT]
[FONT="]3. [/FONT][FONT="]3. I want, When I add a value to table TBLHocVien then that value add to table TBLDiem, too. Can I use BindingSource.Copy() ?[/FONT]
[FONT="]I need your help. Thank you very much ![/FONT]
[FONT="]1. [/FONT][FONT="] I make a Connect with this databse, but I don’t use Command SQL, I make connect to Database by Winzard in VB.Net 2005.[/FONT]
[FONT="][/FONT]
[FONT="]I Add Row, Edit, Delete,or Update by VB.net it’s OK. But then I opened Database by Access and I add more a few Table or Field, then VB.net is nothing. So How do I add Field or Table by ways : BindingSource ? [/FONT]
[FONT="]Ex :[/FONT]
[FONT="]Me.Validate()
Me.TBLDIEMDANHBindingSource.EndEdit()
Me.TBLDIEMDANHTableAdapter.Update(Me.DatabaseDataSet.TBLDIEMDANH)[/FONT]
[FONT="]2. [/FONT][FONT="]2. The Second Problem is : when I edit DataSet in Window DataSource[/FONT]
[FONT="]
[FONT="]And I add more a Column : TenHV Form Table TBLHocVien to Table TBLDiem by ways Query as below:[/FONT]
[FONT="]
[FONT="]
[FONT="]And the result on Dateset show as below:[/FONT]
[FONT="]
[FONT="]DataGrid of table TBLDiem as below:[/FONT]
[FONT="]
[FONT="]The result : Column TenHV on DataGrid show OK as TBLHocVien. But when I Run and I edit value Column on DataGrid. And I Update to Database, it’s nothing. I can’t. I use:[/FONT]
[FONT="]Me.Validate()
Me.TBLDIEMDANHBindingSource.EndEdit()
Me.TBLDIEMDANHTableAdapter.Update(Me.DatabaseDataSet.TBLDIEMDANH)[/FONT]
[FONT="]‘Error in line 3, Because it hasn’t Update. So How can I update to database ? [/FONT]
[FONT="]3. [/FONT][FONT="]3. I want, When I add a value to table TBLHocVien then that value add to table TBLDiem, too. Can I use BindingSource.Copy() ?[/FONT]
[FONT="]I need your help. Thank you very much ![/FONT]