typed dataset xsd

Discussion in 'ASP .Net' started by Rotsey, Dec 9, 2006.

  1. Rotsey

    Rotsey Guest

    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
     
    Rotsey, Dec 9, 2006
    #1
    1. Advertising

  2. Rotsey

    sloan Guest

    You have to pick one of the tables.

    > gridview1.Datasource = ds.Tables[0];
    > gridview1.DataBind()


    And you probably have to define some fields (boundColumns?) in the Grid
    itself.



    "Rotsey" <> wrote in message
    news:...
    > 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
    >
    >
    >
     
    sloan, Dec 9, 2006
    #2
    1. Advertising

  3. 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 :
    http://www.samspublishing.com/articles/article.asp?p=25460&rl=1

    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.Datasource = ds
    > gridview1.DataBind()
    >
    >
    > Example code would be helpful cause I am lost??
    >
    > rotsey
    >
    >
    >
    >
     
    =?Utf-8?B?TWFuaXNoIEJhZm5h?=, Dec 9, 2006
    #3
  4. Rotsey

    Scott M. Guest

    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" <> wrote in message
    news:...
    > 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
    >
    >
    >
     
    Scott M., Dec 9, 2006
    #4
  5. 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.Datasource = ds
    > gridview1.DataBind()
    >
    > 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
    http://bytes.thinkersroom.com
     
    Rad [Visual C# MVP], Dec 9, 2006
    #5
  6. Rotsey

    Rotsey Guest

    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.ProjectsDataTable

    Dim dtUser As DataSet1.UsersDataTable

    dtProj = New DataSet1TableAdapters.ProjectsTableAdapter().GetProjects

    dtUser = New DataSet1TableAdapters.UsersTableAdapter().GetUsers

    Me.GridView1.DataSource = dtProj

    Me.DataBind()

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

    rotsey




    "Rotsey" <> wrote in message
    news:...
    > 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
    >
    >
    >
     
    Rotsey, Dec 10, 2006
    #6
  7. Rotsey

    Scott M. Guest

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


    "Rotsey" <> wrote in message
    news:...
    > 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.ProjectsDataTable
    >
    > Dim dtUser As DataSet1.UsersDataTable
    >
    > dtProj = New DataSet1TableAdapters.ProjectsTableAdapter().GetProjects
    >
    > dtUser = New DataSet1TableAdapters.UsersTableAdapter().GetUsers
    >
    > Me.GridView1.DataSource = dtProj
    >
    > Me.DataBind()
    >
    > Here I am only binding one table. How do I bind the dataset???????
    >
    > rotsey
    >
    >
    >
    >
    > "Rotsey" <> wrote in message
    > news:...
    >> 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
    >>
    >>
    >>

    >
    >
     
    Scott M., Dec 10, 2006
    #7
  8. Rotsey

    Rotsey Guest

    But I am trying to bind to the dataset.

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


    "Scott M." <> wrote in message
    news:...
    > You are already binding your GridView to a table in the dataset. That's
    > all you need.
    >
    >
    > "Rotsey" <> wrote in message
    > news:...
    >> 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.ProjectsDataTable
    >>
    >> Dim dtUser As DataSet1.UsersDataTable
    >>
    >> dtProj = New DataSet1TableAdapters.ProjectsTableAdapter().GetProjects
    >>
    >> dtUser = New DataSet1TableAdapters.UsersTableAdapter().GetUsers
    >>
    >> Me.GridView1.DataSource = dtProj
    >>
    >> Me.DataBind()
    >>
    >> Here I am only binding one table. How do I bind the dataset???????
    >>
    >> rotsey
    >>
    >>
    >>
    >>
    >> "Rotsey" <> wrote in message
    >> news:...
    >>> 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
    >>>
    >>>
    >>>

    >>
    >>

    >
    >
     
    Rotsey, Dec 10, 2006
    #8
  9. Rotsey

    sloan Guest

    sloan, Dec 10, 2006
    #9
  10. Rotsey

    Rotsey Guest

    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" <> wrote in message
    news:...
    > http://www.google.com/search?hl=en&q=gridview nested
    >
    > http://www.codeguru.com/columns/vb/article.php/c12647/
    >
    >
    >
    > "Rotsey" <> wrote in message
    > news:...
    >> 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
    >>
    >>
    >>

    >
    >
     
    Rotsey, Dec 11, 2006
    #10
  11. Rotsey

    Scott M. Guest

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


    "Rotsey" <> wrote in message
    news:...
    > 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" <> wrote in message
    > news:...
    >> http://www.google.com/search?hl=en&q=gridview nested
    >>
    >> http://www.codeguru.com/columns/vb/article.php/c12647/
    >>
    >>
    >>
    >> "Rotsey" <> wrote in message
    >> news:...
    >>> 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
    >>>
    >>>
    >>>

    >>
    >>

    >
    >
     
    Scott M., Dec 11, 2006
    #11
  12. Rotsey

    Rotsey Guest

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


    "Scott M." <> wrote in message
    news:%...
    > You don't point DataSets at controls, you point controls a data sources
    > (such as DataSets).
    >
    >
    > "Rotsey" <> wrote in message
    > news:...
    >> 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" <> wrote in message
    >> news:...
    >>> http://www.google.com/search?hl=en&q=gridview nested
    >>>
    >>> http://www.codeguru.com/columns/vb/article.php/c12647/
    >>>
    >>>
    >>>
    >>> "Rotsey" <> wrote in message
    >>> news:...
    >>>> 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
    >>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
     
    Rotsey, Dec 11, 2006
    #12
  13. Rotsey

    Scott M. Guest

    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" <> wrote in message
    news:...
    > so intelligent....but not enough to answer the question.
    >
    >
    > "Scott M." <> wrote in message
    > news:%...
    >> You don't point DataSets at controls, you point controls a data sources
    >> (such as DataSets).
    >>
    >>
    >> "Rotsey" <> wrote in message
    >> news:...
    >>> 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" <> wrote in message
    >>> news:...
    >>>> http://www.google.com/search?hl=en&q=gridview nested
    >>>>
    >>>> http://www.codeguru.com/columns/vb/article.php/c12647/
    >>>>
    >>>>
    >>>>
    >>>> "Rotsey" <> wrote in message
    >>>> news:...
    >>>>> 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
    >>>>>
    >>>>>
    >>>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
     
    Scott M., Dec 12, 2006
    #13
  14. Rotsey

    Rotsey Guest

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


    "Scott M." <> wrote in message
    news:...
    > 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" <> wrote in message
    > news:...
    >> so intelligent....but not enough to answer the question.
    >>
    >>
    >> "Scott M." <> wrote in message
    >> news:%...
    >>> You don't point DataSets at controls, you point controls a data sources
    >>> (such as DataSets).
    >>>
    >>>
    >>> "Rotsey" <> wrote in message
    >>> news:...
    >>>> 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" <> wrote in message
    >>>> news:...
    >>>>> http://www.google.com/search?hl=en&q=gridview nested
    >>>>>
    >>>>> http://www.codeguru.com/columns/vb/article.php/c12647/
    >>>>>
    >>>>>
    >>>>>
    >>>>> "Rotsey" <> wrote in message
    >>>>> news:...
    >>>>>> 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
    >>>>>>
    >>>>>>
    >>>>>>
    >>>>>
    >>>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
     
    Rotsey, Dec 13, 2006
    #14
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nedu N
    Replies:
    1
    Views:
    1,818
    Chris Taylor
    Oct 31, 2003
  2. Nedu N
    Replies:
    2
    Views:
    2,172
  3. William Gower
    Replies:
    2
    Views:
    4,157
    Brian Baker [MVP]
    Jul 26, 2004
  4. thomson
    Replies:
    2
    Views:
    14,839
    Eliyahu Goldin
    Jan 19, 2005
  5. Matthew Baskey

    xsd.exe Typed DataSet generation

    Matthew Baskey, Sep 3, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    135
    Sean S.
    Sep 3, 2004
Loading...

Share This Page