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. Visual Basic
  4. How to expose a datatable in a strongly typed dataset (without exposing the whole dataset).

How to expose a datatable in a strongly typed dataset (without exposing the whole dataset).

Scheduled Pinned Locked Moved Visual Basic
questiontutorial
2 Posts 1 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.
  • J Offline
    J Offline
    Jon_Boy
    wrote on last edited by
    #1

    I have a assembly that contains a class and a strongly typed dataset. I want to expose one datatable as the return datatype on a function - but not expose the whole dataset. For example:

    Public Function GetImportSortOrder(ByVal vEffDate As String, _
    ByVal vPlant As Integer, _
    ByVal vImportID As Integer) As BusinessLogic.DataSet_ImportData.DataTable_ScheduleOrdersDataTable

    If I have the dataset modified set to public, the table in question can be seen externally. If I instantiate the datatable, I can create a SO datatable such as: dim o as BusinessLogic.DataSet_ImportData.DataTable_ScheduleOrdersDataTable But all the other datatables in the dataset are also listed. I don't want to show/expose the other datatables. If I go into the dataset.designer.vb file and change the modifier to friend on all other datatables, the modifer is changed back to public when I recompile. How can I accomplish just exposing the one datatable and not all of them? The tableadapters have a "Modifier" property that does just this, but not the datatables themselves. I'm probably overlooking something simple. Thanks for any guidance.

    "There's no such thing as a stupid question, only stupid people." - Mr. Garrison

    J 1 Reply Last reply
    0
    • J Jon_Boy

      I have a assembly that contains a class and a strongly typed dataset. I want to expose one datatable as the return datatype on a function - but not expose the whole dataset. For example:

      Public Function GetImportSortOrder(ByVal vEffDate As String, _
      ByVal vPlant As Integer, _
      ByVal vImportID As Integer) As BusinessLogic.DataSet_ImportData.DataTable_ScheduleOrdersDataTable

      If I have the dataset modified set to public, the table in question can be seen externally. If I instantiate the datatable, I can create a SO datatable such as: dim o as BusinessLogic.DataSet_ImportData.DataTable_ScheduleOrdersDataTable But all the other datatables in the dataset are also listed. I don't want to show/expose the other datatables. If I go into the dataset.designer.vb file and change the modifier to friend on all other datatables, the modifer is changed back to public when I recompile. How can I accomplish just exposing the one datatable and not all of them? The tableadapters have a "Modifier" property that does just this, but not the datatables themselves. I'm probably overlooking something simple. Thanks for any guidance.

      "There's no such thing as a stupid question, only stupid people." - Mr. Garrison

      J Offline
      J Offline
      Jon_Boy
      wrote on last edited by
      #2

      Was my question clear enough or can this not be done? Not a critical question, just curious if it could be done.

      "There's no such thing as a stupid question, only stupid people." - Mr. Garrison

      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