Click here to Skip to main content
15,891,943 members

vb .net 2008 ado master detail problem

Member 3892343 asked:

Open original thread
Hello,
I have an sql server 2008 database with 2 tables, a master (Table_1) and a detail (Table_2). I have created an application (windows forms) in vb .net 2008, I used ado (sqldataadapter, sqlconnection, dataset), 1st adapter (sqldatadapter1) added the master table and second adapter (sqldatadapter2) added the detail. I have right click in the adapters and generated the same dataset (dataset1). I opened the dataset1 (double click) and view the 2 tables, I dragged from the master pk to the detail fk the mouse and created the relationship (sorry for the long description). In the detail I have an image field so I cannot make a master/detail datagrid, I have to have seperated textboxes for the master and a picturebox for the detail. My problem is when I move to the next record of the detail
VB
Me.BindingContext(DataSet21, "Table_2").Position = (Me.BindingContext(DataSet21, "Table_2").Position + 1)

I move to the next id of the master, I want to move to the next detail record of the same master record, how can I do that programmatically? or do I have to write an sql select command string with an INNER JOIN?

Thank you
Kyriakos
Tags: Visual Basic, ADO.NET, SQL Server, SQL Server 2008

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900