none
cannot find relation RRS feed

Answers

  • Use Adapter's fill method to populate data to tables.

     

    For example,

     

    NoterDataSet noterDataSetInstance = new NoterDataSet();

    noterDataSetInstance.EnforceConstraints = true;

    NoterDataSetTableAdapters.KundeTableAdapter kundeTableAdapter = new NoterDataSetTableAdapters.KundeTableAdapter();

     

    kundeTableAdapter.fill(noterDataSetInstance,noterDataSetInstance.Kunde.TableName);

     

    Thanks

    Hari

    Friday, August 22, 2008 6:50 AM

All replies

  • Above code does'nt create instance for dataset. Hence tables are not related. See below code to create the instance of the dataset.

     

    NoterDataSet  noterDataSetInstance=new NoterDataSet();

    noterDataSetInstance.EnforceConstraints =true
    NoterDataSetTableAdapters.KundeTableAdapter kundeTableAdapter = new NoterDataSetTableAdapters.KundeTableAdapter();

    noterDataSetInstance.KundeDataTable = kundeTableAdapter.GetData();

    NoterDataSetTableAdapters.NoteringTableAdapter noteringTableAdapter = new NoterDataSetTableAdapters.NoteringTableAdapter();

    noterDataSetInstance.NoteringDataTable  = noteringTableAdapter.GetData();

     

    Hope this solves your problem.

     

    Thanks

    Hari

     

    Tuesday, August 12, 2008 5:10 PM
  •  

    Hi Hari

     

    Thank you for your reply.

     

    But when i create an instance of the dataset, I lose the option of using the datatables under it.
    Do you know what I mean?

     

    /Thomas

    Wednesday, August 13, 2008 1:09 PM
  • No. Can you please explain little bit more on this.

    Wednesday, August 13, 2008 3:38 PM
  • Can you post the dataset difinition class here.

     

    Wednesday, August 13, 2008 4:49 PM
  • Everything looks fine to me

     

    [global:Tongue Tiedystem.Diagnostics.DebuggerNonUserCodeAttribute()]
            [global:Tongue Tiedystem.ComponentModel.Browsable(false)]
            [global:Tongue Tiedystem.ComponentModel.DesignerSerializationVisibility(global:Tongue Tiedystem.ComponentModel.DesignerSerializationVisibility.Content)]
            public KundeDataTable Kunde {
                get {
                    return this.tableKunde;
                }
            }

     

    The KundeDataTable  table is exposed as "Kunde " property. which is fine. You can use this property to load the data.

    Friday, August 15, 2008 4:51 AM
  • Yes, but it is read only.

     

    Friday, August 15, 2008 5:21 AM
  • You can populate the data and use.

    Friday, August 15, 2008 1:41 PM
  • How do I do that?

     

    Not like this:

     

    Code Snippet

    NoterDataSet noterDataSetInstance = new NoterDataSet();

    noterDataSetInstance.EnforceConstraints = true;

    NoterDataSetTableAdapters.KundeTableAdapter kundeTableAdapter = new NoterDataSetTableAdapters.KundeTableAdapter();

    noterDataSetInstance.Kunde = kundeTableAdapter.GetData();

    NoterDataSetTableAdapters.NoteringTableAdapter noteringTableAdapter = new NoterDataSetTableAdapters.NoteringTableAdapter();

    noterDataSetInstance.Notering = noteringTableAdapter.GetData();

     

     

     

    Friday, August 15, 2008 2:35 PM
  • Use Adapter's fill method to populate data to tables.

     

    For example,

     

    NoterDataSet noterDataSetInstance = new NoterDataSet();

    noterDataSetInstance.EnforceConstraints = true;

    NoterDataSetTableAdapters.KundeTableAdapter kundeTableAdapter = new NoterDataSetTableAdapters.KundeTableAdapter();

     

    kundeTableAdapter.fill(noterDataSetInstance,noterDataSetInstance.Kunde.TableName);

     

    Thanks

    Hari

    Friday, August 22, 2008 6:50 AM
  • Yes! It worked! Thank you so much for all your help.

     

    My final code is this:

    Code Snippet

     

    NoterDataSet noterDataSetInstance = new NoterDataSet();

    noterDataSetInstance.EnforceConstraints = true;

    NoterDataSetTableAdapters.KundeTableAdapter kundeTableAdapter = new NoterDataSetTableAdapters.KundeTableAdapter();

    NoterDataSetTableAdapters.NoteringTableAdapter noteringTableAdapter = new NoterDataSetTableAdapters.NoteringTableAdapter();

    NoterDataSet.KundeDataTable kundeTable = noterDataSetInstance.Kunde;

    kundeTableAdapter.Fill(kundeTable);

    NoterDataSet.NoteringDataTable noteringTable = noterDataSetInstance.Notering;

    noteringTableAdapter.Fill(noteringTable);

     

     

     

    Friday, August 22, 2008 8:29 PM