typed dataset xsd

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

    typed dataset xsd

    Hi,

    I have created a typed dataset (xsd file) with 2 tables and a relation
    between them
    in VS2005.

    How I do I now bind that dataset to a Gridview??

    When i do this the page is blank.

    ds = New DataSet1()

    gridview1.Datas ource = ds
    gridview1.DataB ind()


    Example code would be helpful cause I am lost??

    rotsey



  • sloan

    #2
    Re: typed dataset xsd


    You have to pick one of the tables.
    gridview1.Datas ource = ds.Tables[0];
    gridview1.DataB ind()
    And you probably have to define some fields (boundColumns?) in the Grid
    itself.



    "Rotsey" <malcolm_smith@ RemoveThis.optu snet.com.auwrot e in message
    news:eB31gK5GHH A.4844@TK2MSFTN GP05.phx.gbl...
    Hi,
    >
    I have created a typed dataset (xsd file) with 2 tables and a relation
    between them
    in VS2005.
    >
    How I do I now bind that dataset to a Gridview??
    >
    When i do this the page is blank.
    >
    ds = New DataSet1()
    >
    gridview1.Datas ource = ds
    gridview1.DataB ind()
    >
    >
    Example code would be helpful cause I am lost??
    >
    rotsey
    >
    >
    >

    Comment

    • Manish Bafna

      #3
      RE: typed dataset xsd

      Hi,
      There are more than one table in your dataset.So you need to set datamember
      property of the gridview also.You will find complete working code in the
      following URL :


      Thanks and regards,
      manish bafna

      "Rotsey" wrote:
      Hi,
      >
      I have created a typed dataset (xsd file) with 2 tables and a relation
      between them
      in VS2005.
      >
      How I do I now bind that dataset to a Gridview??
      >
      When i do this the page is blank.
      >
      ds = New DataSet1()
      >
      gridview1.Datas ource = ds
      gridview1.DataB ind()
      >
      >
      Example code would be helpful cause I am lost??
      >
      rotsey
      >
      >
      >
      >

      Comment

      • Scott M.

        #4
        Re: typed dataset xsd

        Making an instance of a typed dataset is only step one. You need to
        populate it with data before a grid that is bound to it would show anything.


        "Rotsey" <malcolm_smith@ RemoveThis.optu snet.com.auwrot e in message
        news:eB31gK5GHH A.4844@TK2MSFTN GP05.phx.gbl...
        Hi,
        >
        I have created a typed dataset (xsd file) with 2 tables and a relation
        between them
        in VS2005.
        >
        How I do I now bind that dataset to a Gridview??
        >
        When i do this the page is blank.
        >
        ds = New DataSet1()
        >
        gridview1.Datas ource = ds
        gridview1.DataB ind()
        >
        >
        Example code would be helpful cause I am lost??
        >
        rotsey
        >
        >
        >

        Comment

        • Rad [Visual C# MVP]

          #5
          Re: typed dataset xsd

          On Sun, 10 Dec 2006 00:03:56 +1100, Rotsey wrote:
          Hi,
          >
          I have created a typed dataset (xsd file) with 2 tables and a relation
          between them
          in VS2005.
          >
          How I do I now bind that dataset to a Gridview??
          >
          When i do this the page is blank.
          >
          ds = New DataSet1()
          >
          gridview1.Datas ource = ds
          gridview1.DataB ind()
          >
          Example code would be helpful cause I am lost??
          >
          rotsey
          You don't seem to be populating your dataset with any data! Also, if there
          is more than one table, you need to set the datamember property to one of
          the tables
          --
          Bits.Bytes

          Comment

          • Rotsey

            #6
            Re: typed dataset xsd

            Guys,

            I realize I have to populate the dataset.

            I am trying to create a Grdview with nested data
            ie showing parent/child rows.

            I have found out doing some googling that all I do is
            set up a relation in the dataset between the 2 tables
            and then bind it to a grdiview and it will do the rest.

            I have this code now.
            Dim dtProj As DataSet1.Projec tsDataTable

            Dim dtUser As DataSet1.UsersD ataTable

            dtProj = New DataSet1TableAd apters.Projects TableAdapter(). GetProjects

            dtUser = New DataSet1TableAd apters.UsersTab leAdapter().Get Users

            Me.GridView1.Da taSource = dtProj

            Me.DataBind()

            Here I am only binding one table. How do I bind the dataset???????

            rotsey




            "Rotsey" <malcolm_smith@ RemoveThis.optu snet.com.auwrot e in message
            news:eB31gK5GHH A.4844@TK2MSFTN GP05.phx.gbl...
            Hi,
            >
            I have created a typed dataset (xsd file) with 2 tables and a relation
            between them
            in VS2005.
            >
            How I do I now bind that dataset to a Gridview??
            >
            When i do this the page is blank.
            >
            ds = New DataSet1()
            >
            gridview1.Datas ource = ds
            gridview1.DataB ind()
            >
            >
            Example code would be helpful cause I am lost??
            >
            rotsey
            >
            >
            >

            Comment

            • Scott M.

              #7
              Re: typed dataset xsd

              You are already binding your GridView to a table in the dataset. That's all
              you need.


              "Rotsey" <malcolm_smith@ RemoveThis.optu snet.com.auwrot e in message
              news:u8vyuDAHHH A.3872@TK2MSFTN GP06.phx.gbl...
              Guys,
              >
              I realize I have to populate the dataset.
              >
              I am trying to create a Grdview with nested data
              ie showing parent/child rows.
              >
              I have found out doing some googling that all I do is
              set up a relation in the dataset between the 2 tables
              and then bind it to a grdiview and it will do the rest.
              >
              I have this code now.
              Dim dtProj As DataSet1.Projec tsDataTable
              >
              Dim dtUser As DataSet1.UsersD ataTable
              >
              dtProj = New DataSet1TableAd apters.Projects TableAdapter(). GetProjects
              >
              dtUser = New DataSet1TableAd apters.UsersTab leAdapter().Get Users
              >
              Me.GridView1.Da taSource = dtProj
              >
              Me.DataBind()
              >
              Here I am only binding one table. How do I bind the dataset???????
              >
              rotsey
              >
              >
              >
              >
              "Rotsey" <malcolm_smith@ RemoveThis.optu snet.com.auwrot e in message
              news:eB31gK5GHH A.4844@TK2MSFTN GP05.phx.gbl...
              >Hi,
              >>
              >I have created a typed dataset (xsd file) with 2 tables and a relation
              >between them
              >in VS2005.
              >>
              >How I do I now bind that dataset to a Gridview??
              >>
              >When i do this the page is blank.
              >>
              >ds = New DataSet1()
              >>
              >gridview1.Data source = ds
              >gridview1.Data Bind()
              >>
              >>
              >Example code would be helpful cause I am lost??
              >>
              >rotsey
              >>
              >>
              >>
              >
              >

              Comment

              • Rotsey

                #8
                Re: typed dataset xsd

                But I am trying to bind to the dataset.

                So how do you get the parent/child functionality in the
                gridview??????? ???????/


                "Scott M." <s-mar@nospam.nosp amwrote in message
                news:uCjNVICHHH A.1188@TK2MSFTN GP06.phx.gbl...
                You are already binding your GridView to a table in the dataset. That's
                all you need.
                >
                >
                "Rotsey" <malcolm_smith@ RemoveThis.optu snet.com.auwrot e in message
                news:u8vyuDAHHH A.3872@TK2MSFTN GP06.phx.gbl...
                >Guys,
                >>
                >I realize I have to populate the dataset.
                >>
                >I am trying to create a Grdview with nested data
                >ie showing parent/child rows.
                >>
                >I have found out doing some googling that all I do is
                >set up a relation in the dataset between the 2 tables
                >and then bind it to a grdiview and it will do the rest.
                >>
                >I have this code now.
                >Dim dtProj As DataSet1.Projec tsDataTable
                >>
                >Dim dtUser As DataSet1.UsersD ataTable
                >>
                >dtProj = New DataSet1TableAd apters.Projects TableAdapter(). GetProjects
                >>
                >dtUser = New DataSet1TableAd apters.UsersTab leAdapter().Get Users
                >>
                >Me.GridView1.D ataSource = dtProj
                >>
                >Me.DataBind( )
                >>
                >Here I am only binding one table. How do I bind the dataset???????
                >>
                >rotsey
                >>
                >>
                >>
                >>
                >"Rotsey" <malcolm_smith@ RemoveThis.optu snet.com.auwrot e in message
                >news:eB31gK5GH HA.4844@TK2MSFT NGP05.phx.gbl.. .
                >>Hi,
                >>>
                >>I have created a typed dataset (xsd file) with 2 tables and a relation
                >>between them
                >>in VS2005.
                >>>
                >>How I do I now bind that dataset to a Gridview??
                >>>
                >>When i do this the page is blank.
                >>>
                >>ds = New DataSet1()
                >>>
                >>gridview1.Dat asource = ds
                >>gridview1.Dat aBind()
                >>>
                >>>
                >>Example code would be helpful cause I am lost??
                >>>
                >>rotsey
                >>>
                >>>
                >>>
                >>
                >>
                >
                >

                Comment

                • sloan

                  #9
                  Re: typed dataset xsd







                  "Rotsey" <malcolm_smith@ RemoveThis.optu snet.com.auwrot e in message
                  news:eB31gK5GHH A.4844@TK2MSFTN GP05.phx.gbl...
                  Hi,
                  >
                  I have created a typed dataset (xsd file) with 2 tables and a relation
                  between them
                  in VS2005.
                  >
                  How I do I now bind that dataset to a Gridview??
                  >
                  When i do this the page is blank.
                  >
                  ds = New DataSet1()
                  >
                  gridview1.Datas ource = ds
                  gridview1.DataB ind()
                  >
                  >
                  Example code would be helpful cause I am lost??
                  >
                  rotsey
                  >
                  >
                  >

                  Comment

                  • Rotsey

                    #10
                    Re: typed dataset xsd

                    thanks sloan.

                    but I was lead to believe that I could point a dataset at a gridview

                    and it would render the grid with + and - where you could
                    expand and collapse rows.

                    is this just fantasy land??????

                    I just had a thought, as I don't want edit capability would
                    crystal reports do the job???????????? ??



                    "sloan" <sloan@ipass.ne twrote in message
                    news:erNusrGHHH A.960@TK2MSFTNG P04.phx.gbl...

                    >

                    >
                    >
                    >
                    "Rotsey" <malcolm_smith@ RemoveThis.optu snet.com.auwrot e in message
                    news:eB31gK5GHH A.4844@TK2MSFTN GP05.phx.gbl...
                    >Hi,
                    >>
                    >I have created a typed dataset (xsd file) with 2 tables and a relation
                    >between them
                    >in VS2005.
                    >>
                    >How I do I now bind that dataset to a Gridview??
                    >>
                    >When i do this the page is blank.
                    >>
                    >ds = New DataSet1()
                    >>
                    >gridview1.Data source = ds
                    >gridview1.Data Bind()
                    >>
                    >>
                    >Example code would be helpful cause I am lost??
                    >>
                    >rotsey
                    >>
                    >>
                    >>
                    >
                    >

                    Comment

                    • Scott M.

                      #11
                      Re: typed dataset xsd

                      You don't point DataSets at controls, you point controls a data sources
                      (such as DataSets).


                      "Rotsey" <malcolm_smith@ RemoveThis.optu snet.com.auwrot e in message
                      news:ew61o5LHHH A.2456@TK2MSFTN GP06.phx.gbl...
                      thanks sloan.
                      >
                      but I was lead to believe that I could point a dataset at a gridview
                      >
                      and it would render the grid with + and - where you could
                      expand and collapse rows.
                      >
                      is this just fantasy land??????
                      >
                      I just had a thought, as I don't want edit capability would
                      crystal reports do the job???????????? ??
                      >
                      >
                      >
                      "sloan" <sloan@ipass.ne twrote in message
                      news:erNusrGHHH A.960@TK2MSFTNG P04.phx.gbl...
                      >http://www.google.com/search?hl=en&q=gridview+nested
                      >>
                      >http://www.codeguru.com/columns/vb/article.php/c12647/
                      >>
                      >>
                      >>
                      >"Rotsey" <malcolm_smith@ RemoveThis.optu snet.com.auwrot e in message
                      >news:eB31gK5GH HA.4844@TK2MSFT NGP05.phx.gbl.. .
                      >>Hi,
                      >>>
                      >>I have created a typed dataset (xsd file) with 2 tables and a relation
                      >>between them
                      >>in VS2005.
                      >>>
                      >>How I do I now bind that dataset to a Gridview??
                      >>>
                      >>When i do this the page is blank.
                      >>>
                      >>ds = New DataSet1()
                      >>>
                      >>gridview1.Dat asource = ds
                      >>gridview1.Dat aBind()
                      >>>
                      >>>
                      >>Example code would be helpful cause I am lost??
                      >>>
                      >>rotsey
                      >>>
                      >>>
                      >>>
                      >>
                      >>
                      >
                      >

                      Comment

                      • Rotsey

                        #12
                        Re: typed dataset xsd

                        so intelligent.... but not enough to answer the question.


                        "Scott M." <s-mar@nospam.nosp amwrote in message
                        news:%23L3UyNNH HHA.816@TK2MSFT NGP06.phx.gbl.. .
                        You don't point DataSets at controls, you point controls a data sources
                        (such as DataSets).
                        >
                        >
                        "Rotsey" <malcolm_smith@ RemoveThis.optu snet.com.auwrot e in message
                        news:ew61o5LHHH A.2456@TK2MSFTN GP06.phx.gbl...
                        >thanks sloan.
                        >>
                        >but I was lead to believe that I could point a dataset at a gridview
                        >>
                        >and it would render the grid with + and - where you could
                        >expand and collapse rows.
                        >>
                        >is this just fantasy land??????
                        >>
                        >I just had a thought, as I don't want edit capability would
                        >crystal reports do the job???????????? ??
                        >>
                        >>
                        >>
                        >"sloan" <sloan@ipass.ne twrote in message
                        >news:erNusrGHH HA.960@TK2MSFTN GP04.phx.gbl...
                        >>http://www.google.com/search?hl=en&q=gridview+nested
                        >>>
                        >>http://www.codeguru.com/columns/vb/article.php/c12647/
                        >>>
                        >>>
                        >>>
                        >>"Rotsey" <malcolm_smith@ RemoveThis.optu snet.com.auwrot e in message
                        >>news:eB31gK5G HHA.4844@TK2MSF TNGP05.phx.gbl. ..
                        >>>Hi,
                        >>>>
                        >>>I have created a typed dataset (xsd file) with 2 tables and a relation
                        >>>between them
                        >>>in VS2005.
                        >>>>
                        >>>How I do I now bind that dataset to a Gridview??
                        >>>>
                        >>>When i do this the page is blank.
                        >>>>
                        >>>ds = New DataSet1()
                        >>>>
                        >>>gridview1.Da tasource = ds
                        >>>gridview1.Da taBind()
                        >>>>
                        >>>>
                        >>>Example code would be helpful cause I am lost??
                        >>>>
                        >>>rotsey
                        >>>>
                        >>>>
                        >>>>
                        >>>
                        >>>
                        >>
                        >>
                        >
                        >

                        Comment

                        • Scott M.

                          #13
                          Re: typed dataset xsd

                          And, if you'd like to continue being sarcastic, you'll have a hard time
                          getting any information. I was simply trying to alert you to the basic
                          premis of databinding, which by your question seemed like it needed some
                          enlightenment.


                          "Rotsey" <malcolm_smith@ RemoveThis.optu snet.com.auwrot e in message
                          news:uJh0VGSHHH A.4056@TK2MSFTN GP03.phx.gbl...
                          so intelligent.... but not enough to answer the question.
                          >
                          >
                          "Scott M." <s-mar@nospam.nosp amwrote in message
                          news:%23L3UyNNH HHA.816@TK2MSFT NGP06.phx.gbl.. .
                          >You don't point DataSets at controls, you point controls a data sources
                          >(such as DataSets).
                          >>
                          >>
                          >"Rotsey" <malcolm_smith@ RemoveThis.optu snet.com.auwrot e in message
                          >news:ew61o5LHH HA.2456@TK2MSFT NGP06.phx.gbl.. .
                          >>thanks sloan.
                          >>>
                          >>but I was lead to believe that I could point a dataset at a gridview
                          >>>
                          >>and it would render the grid with + and - where you could
                          >>expand and collapse rows.
                          >>>
                          >>is this just fantasy land??????
                          >>>
                          >>I just had a thought, as I don't want edit capability would
                          >>crystal reports do the job???????????? ??
                          >>>
                          >>>
                          >>>
                          >>"sloan" <sloan@ipass.ne twrote in message
                          >>news:erNusrGH HHA.960@TK2MSFT NGP04.phx.gbl.. .
                          >>>http://www.google.com/search?hl=en&q=gridview+nested
                          >>>>
                          >>>http://www.codeguru.com/columns/vb/article.php/c12647/
                          >>>>
                          >>>>
                          >>>>
                          >>>"Rotsey" <malcolm_smith@ RemoveThis.optu snet.com.auwrot e in message
                          >>>news:eB31gK5 GHHA.4844@TK2MS FTNGP05.phx.gbl ...
                          >>>>Hi,
                          >>>>>
                          >>>>I have created a typed dataset (xsd file) with 2 tables and a relation
                          >>>>between them
                          >>>>in VS2005.
                          >>>>>
                          >>>>How I do I now bind that dataset to a Gridview??
                          >>>>>
                          >>>>When i do this the page is blank.
                          >>>>>
                          >>>>ds = New DataSet1()
                          >>>>>
                          >>>>gridview1.D atasource = ds
                          >>>>gridview1.D ataBind()
                          >>>>>
                          >>>>>
                          >>>>Example code would be helpful cause I am lost??
                          >>>>>
                          >>>>rotsey
                          >>>>>
                          >>>>>
                          >>>>>
                          >>>>
                          >>>>
                          >>>
                          >>>
                          >>
                          >>
                          >
                          >

                          Comment

                          • Rotsey

                            #14
                            Re: typed dataset xsd

                            fine.....it sounded like a smart comment.....I apologize


                            "Scott M." <s-mar@nospam.nosp amwrote in message
                            news:eQj9BhZHHH A.1188@TK2MSFTN GP06.phx.gbl...
                            And, if you'd like to continue being sarcastic, you'll have a hard time
                            getting any information. I was simply trying to alert you to the basic
                            premis of databinding, which by your question seemed like it needed some
                            enlightenment.
                            >
                            >
                            "Rotsey" <malcolm_smith@ RemoveThis.optu snet.com.auwrot e in message
                            news:uJh0VGSHHH A.4056@TK2MSFTN GP03.phx.gbl...
                            >so intelligent.... but not enough to answer the question.
                            >>
                            >>
                            >"Scott M." <s-mar@nospam.nosp amwrote in message
                            >news:%23L3UyNN HHHA.816@TK2MSF TNGP06.phx.gbl. ..
                            >>You don't point DataSets at controls, you point controls a data sources
                            >>(such as DataSets).
                            >>>
                            >>>
                            >>"Rotsey" <malcolm_smith@ RemoveThis.optu snet.com.auwrot e in message
                            >>news:ew61o5LH HHA.2456@TK2MSF TNGP06.phx.gbl. ..
                            >>>thanks sloan.
                            >>>>
                            >>>but I was lead to believe that I could point a dataset at a gridview
                            >>>>
                            >>>and it would render the grid with + and - where you could
                            >>>expand and collapse rows.
                            >>>>
                            >>>is this just fantasy land??????
                            >>>>
                            >>>I just had a thought, as I don't want edit capability would
                            >>>crystal reports do the job???????????? ??
                            >>>>
                            >>>>
                            >>>>
                            >>>"sloan" <sloan@ipass.ne twrote in message
                            >>>news:erNusrG HHHA.960@TK2MSF TNGP04.phx.gbl. ..
                            >>>>http://www.google.com/search?hl=en&q=gridview+nested
                            >>>>>
                            >>>>http://www.codeguru.com/columns/vb/article.php/c12647/
                            >>>>>
                            >>>>>
                            >>>>>
                            >>>>"Rotsey" <malcolm_smith@ RemoveThis.optu snet.com.auwrot e in message
                            >>>>news:eB31gK 5GHHA.4844@TK2M SFTNGP05.phx.gb l...
                            >>>>>Hi,
                            >>>>>>
                            >>>>>I have created a typed dataset (xsd file) with 2 tables and a
                            >>>>>relation
                            >>>>>between them
                            >>>>>in VS2005.
                            >>>>>>
                            >>>>>How I do I now bind that dataset to a Gridview??
                            >>>>>>
                            >>>>>When i do this the page is blank.
                            >>>>>>
                            >>>>>ds = New DataSet1()
                            >>>>>>
                            >>>>>gridview1. Datasource = ds
                            >>>>>gridview1. DataBind()
                            >>>>>>
                            >>>>>>
                            >>>>>Example code would be helpful cause I am lost??
                            >>>>>>
                            >>>>>rotsey
                            >>>>>>
                            >>>>>>
                            >>>>>>
                            >>>>>
                            >>>>>
                            >>>>
                            >>>>
                            >>>
                            >>>
                            >>
                            >>
                            >
                            >

                            Comment

                            Working...