DataSet copy

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Soulless

    DataSet copy

    Hi, is there any way to copy a dataset to a datagrid? I have a
    dataset and want to copy to a datagridview, but I get no results....
    thx!

  • =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=

    #2
    RE: DataSet copy

    Soulless,
    you cannot "copy" a DataSet to a DataGrid. DataGrid only knows how to do
    DataBinding against the DataSource.
    So, you set DataSource property of the DataGrid to DataSet, or to one of the
    DataTables in the DataSet.
    -- Peter
    // Abandon all hope, ye who enter here.

    unBlog: http://petesbloggerama.blogspot.com
    BlogMetaFinder: http://www.blogmetafinder.com



    "Soulless" wrote:
    Hi, is there any way to copy a dataset to a datagrid? I have a
    dataset and want to copy to a datagridview, but I get no results....
    thx!
    >
    >

    Comment

    • Soulless

      #3
      Re: DataSet copy

      On Nov 1, 3:22 pm, Peter Bromberg [C# MVP]
      <pbromb...@yaho o.NoSpamMaam.co mwrote:
      Soulless,
      you cannot "copy" a DataSet to a DataGrid. DataGrid only knows how to do
      DataBinding against the DataSource.
      So, you set DataSource property of the DataGrid to DataSet, or to one of the
      DataTables in the DataSet.
      -- Peter
      // Abandon all hope, ye who enter here.http://www.eggheadcafe.com
      unBlog:http://petesbloggerama.blogspot.com
      BlogMetaFinder: http://www.blogmetafinder.com
      >
      >
      >
      "Soulless" wrote:
      Hi, is there any way to copy a dataset to a datagrid? I have a
      dataset and want to copy to a datagridview, but I get no results....
      thx!- Hide quoted text -
      >
      - Show quoted text -
      I created a dataset and set my datasource of the grid to it.

      I am getting the following error now:

      Error 12 Cannot implicitly convert type 'System.Data.Da taTable' to
      'OpTx.Extract.D ataSet.Impac.ds UpdateSQL' C:\develop\extr act\Forms\Impac
      \FormScheduleNo tes.cs 720 28 Forms

      The line of code is:

      dsUpdateSQL1 = ibrScheduleNote s.dsSched.Table s["Schedule"].Copy();

      dsUpdateSQL1 is my dataset.

      Any ideas?


      Comment

      • Soulless

        #4
        Re: DataSet copy

        On Nov 1, 3:22 pm, Peter Bromberg [C# MVP]
        <pbromb...@yaho o.NoSpamMaam.co mwrote:
        Soulless,
        you cannot "copy" a DataSet to a DataGrid. DataGrid only knows how to do
        DataBinding against the DataSource.
        So, you set DataSource property of the DataGrid to DataSet, or to one of the
        DataTables in the DataSet.
        -- Peter
        // Abandon all hope, ye who enter here.http://www.eggheadcafe.com
        unBlog:http://petesbloggerama.blogspot.com
        BlogMetaFinder: http://www.blogmetafinder.com
        >
        >
        >
        "Soulless" wrote:
        Hi, is there any way to copy a dataset to a datagrid? I have a
        dataset and want to copy to a datagridview, but I get no results....
        thx!- Hide quoted text -
        >
        - Show quoted text -
        Hi,

        I have created a dataset and have set my datasource on the grid to the
        dataset.

        I get the following error:

        Error 12 Cannot implicitly convert type 'System.Data.Da taTable' to
        'OpTx.Extract.D ataSet.Impac.ds UpdateSQL' C:\develop\extr act\Forms\Impac
        \FormScheduleNo tes.cs 720 28 Forms

        The syntax is:

        dsUpdateSQL1 = ibrScheduleNote s.dsSched.Table s["Schedule"].Copy();

        dsUpdateSQL1 is my dataset and the ibrScheduleNote s.dsSched is a
        dataset from another class.

        Comment

        • bob clegg

          #5
          Re: DataSet copy


          Hi,
          Wouldn't the copy have to be table to table?
          The ouput of copy is a datatable not a dataset.
          dsUpdateSQL1.Ta bles["mySchedule "] =
          ibrScheduleNote s.dsSched.Table s["Schedule"].Copy();
          I haven't tried this just seems logical.
          hth
          Bob


          On 1 Nov 2007 15:48:25 -0700, Soulless <dgmsalter@gmai l.comwrote:
          >On Nov 1, 3:22 pm, Peter Bromberg [C# MVP]
          ><pbromb...@yah oo.NoSpamMaam.c omwrote:
          >Soulless,
          >you cannot "copy" a DataSet to a DataGrid. DataGrid only knows how to do
          >DataBinding against the DataSource.
          >So, you set DataSource property of the DataGrid to DataSet, or to one of the
          >DataTables in the DataSet.
          >-- Peter
          >// Abandon all hope, ye who enter here.http://www.eggheadcafe.com
          >unBlog:http://petesbloggerama.blogspot.com
          >BlogMetaFinder : http://www.blogmetafinder.com
          >>
          >>
          >>
          >"Soulless" wrote:
          Hi, is there any way to copy a dataset to a datagrid? I have a
          dataset and want to copy to a datagridview, but I get no results....
          thx!- Hide quoted text -
          >>
          >- Show quoted text -
          >
          >Hi,
          >
          >I have created a dataset and have set my datasource on the grid to the
          >dataset.
          >
          >I get the following error:
          >
          >Error 12 Cannot implicitly convert type 'System.Data.Da taTable' to
          >'OpTx.Extract. DataSet.Impac.d sUpdateSQL' C:\develop\extr act\Forms\Impac
          >\FormScheduleN otes.cs 720 28 Forms
          >
          >The syntax is:
          >
          >dsUpdateSQL1 = ibrScheduleNote s.dsSched.Table s["Schedule"].Copy();
          >
          >dsUpdateSQL1 is my dataset and the ibrScheduleNote s.dsSched is a
          >dataset from another class.

          Comment

          Working...