New question to DataLink....

New question to DataLink....

Postby Zero-G. » Wed 20 Feb 2008 16:26

Hey
I use VB.NET & your latest controls of My.Direct

I have an UserControl, the Textboxes are bound to the DataLink (at DesignTime). What I want to do, is that each offer should get his own TabPage. - Therefore, I do the following code:
Code: Select all
    Public Sub New(ByVal KundenID As Long)

        InitializeComponent()

        Dim nTab As New Janus.Windows.UI.Tab.UITabPage

        Dim Brille As New VOPTBasis.ISBrilleDaten
        Brille.Dock = DockStyle.Fill

        nTab.Controls.Add(Brille)
        Me.tabBrille.TabPages.Add(nTab)
        DatenFüllen(KundenID, Brille.DtsBrille, _
            Brille.DtAdapterBrille, Brille.AuftragbrilleLink)
        Brille.AuftragbrilleLink.AddNew()
    End Sub
    Private Sub DatenFüllen(ByVal KundenID As Long, ByVal dts As CoreLab.MySql.MySqlDataSet, _
        ByVal dtAdapter As CoreLab.MySql.MySqlDataAdapter, ByVal Link As CoreLab.Data.DataLink)
     
        dtAdapter.SelectCommand.Parameters("KundenID").Value = KundenID
        dtAdapter.Fill(dts)
        Link.MoveFirst()
        For i As Integer = 0 To Link.Count - 1
            Dim dRow As CoreLab.Common.DbDataRowView = Link.Current
            Dim Brille As New VOPTBasis.ISBrilleDaten
            Dim nTab As New Janus.Windows.UI.Tab.UITabPage
            nTab.Controls.Add(Brille)
            Brille.Dock = DockStyle.Fill
            Me.tabBrille.TabPages.Add(nTab)
            Link.MoveNext()
        Next
      End Sub

So, the TabPages are filled correct. - But the problem is, that the Textboxes, have all (in all TabPages) the same Values.
Can you please tell me, how to make this correct?
THX
Zero-G.
 
Posts: 390
Joined: Sat 09 Dec 2006 12:20

Postby Alexey.mdr » Thu 21 Feb 2008 12:06

Try debugging you application.
Step-by-step you will catch the problem.
If it didn't help please send me a small test project with a database table definition.
Alexey.mdr
 
Posts: 729
Joined: Thu 13 Dec 2007 10:24


Return to dotConnect for MySQL