?
Solved

VB .NET master\detail database update position Datagridview

Posted on 2009-05-11
5
Medium Priority
?
2,267 Views
Last Modified: 2013-12-26
Hello,
I have a master\detail database with two tables, I have connected them in one dataset and made the relatioship,
I insert on the form one textbox with the databinding to the field of the master table and a datagridview to the datasource and datamember of the detail table.
I want to have a button to move to the next row of the master and to follow the datagrid to the details of the of the record of the textbox.
here is some code wich is not working.
Private Sub SetRowPos(ByVal intPos As Integer)
        DataGrid1.NavigateBack()
        Me.BindingContext(DataSet81, "EPONIMIA").Position = intPos
        DataGrid1.NavigateTo(intPos, "KATASTASI")
    End Sub
 
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim intpos As New Int32
        Try
            intpos = Me.BindingContext(DataSet81, "EPONIMIA").Position
            intpos += 1
             SetRowPos(intpos)
        Catch errobj As Exception
            MsgBox(errobj.Message & vbCrLf & errobj.StackTrace)
        End Try

Open in new window

0
Comment
Question by:kyriakos70
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 9

Accepted Solution

by:
Deathrace earned 2000 total points
ID: 24356577
hey,
correct me if i'm wrong, you are looking to populate Details view for a particular ..if so refer below links

http://www.homeandlearn.co.uk/NET/nets12p7.html
http://www.vbdotnetheaven.com/Upload...avigation.aspx
0
 
LVL 9

Expert Comment

by:Deathrace
ID: 24356580
above link helps you how to nagivate between the records in DB table...
0
 
LVL 9

Assisted Solution

by:Deathrace
Deathrace earned 2000 total points
ID: 24356612
how to use binding context, for navigation.
http://discuss.itacumens.com/index.php?topic=19966.0
0
 

Author Comment

by:kyriakos70
ID: 24356880
I need the procedure exactly on how to show the master table to textbox and the details to a datagrid.

Kyriakos
0
 

Author Comment

by:kyriakos70
ID: 24368413
I have two tables master with two fields id=pk and EPONIMIA = char I set up 2 sqldataadapters one for the master and one for the detail table. I have generated a dataset and made the relationship inside the dataset by drag and drop the master pk to the detail fk. I have put on a form 2 texboxes one for each field of the master and a datagridview for the detailthe datagridview datasource to the detail table.
But when I run the application the datagrid view displays all the records I want to display only the records shown in the textboxes.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month14 days, 9 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question