Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. DataAdapter and muliple tables

DataAdapter and muliple tables

Scheduled Pinned Locked Moved .NET (Core and Framework)
helpdatabasewpfwcfdesign
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Luke Murray
    wrote on last edited by
    #1

    Hey all. I am trying to set up a data adapter to show me a list of class. I do this with a select command that inner joins on some other tables to get some names etc. Then double clicking on an item brings up a dialog to edit that data. The issue i'm having I guess is a design one. because I have all the data in the dataset on the form with the list should I use that to do the binding and editing in the popup dialog. This way I save a trip to the DB to get data I already have? If so, I then have to problem of I can't run DataAdapter.Update because the select command had inner join it did not generate update command or inserts. So I can have two dataAdpaters each selecting their own table. Then when I update after the dialog closes. it will work. But then on the list I don't get the names showing as I havn't joined the tables in the select. Is there a way to create a Expression column in one table (that is bound to th elist) that gets the correct name from the second table? The dataset has the relations set up in the xsd already. Cheers, Hope that makes some sense. Thanks Luke

    R 1 Reply Last reply
    0
    • L Luke Murray

      Hey all. I am trying to set up a data adapter to show me a list of class. I do this with a select command that inner joins on some other tables to get some names etc. Then double clicking on an item brings up a dialog to edit that data. The issue i'm having I guess is a design one. because I have all the data in the dataset on the form with the list should I use that to do the binding and editing in the popup dialog. This way I save a trip to the DB to get data I already have? If so, I then have to problem of I can't run DataAdapter.Update because the select command had inner join it did not generate update command or inserts. So I can have two dataAdpaters each selecting their own table. Then when I update after the dialog closes. it will work. But then on the list I don't get the names showing as I havn't joined the tables in the select. Is there a way to create a Expression column in one table (that is bound to th elist) that gets the correct name from the second table? The dataset has the relations set up in the xsd already. Cheers, Hope that makes some sense. Thanks Luke

      R Offline
      R Offline
      Robert Rohde
      wrote on last edited by
      #2

      Sure :) Have a look at the DataColumn.Expression description on MSDN. Just add a column to your table and give a valid expression. This even works for aggregation of values from all childs of one parent etc.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups