|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Is this possibleHi,
I am populating a dataset from a webservice. One one page of my app I need to get only the first 5 rows from the dataset to pupulate a datagrid and on another page I then will display all the rows from that dataset in a grid. Is it possible to select a specific amount of rows from the dataset? Please don't tell me to use the TOP in a select statement. Remember I am calling a webservice. Thanks Yes, remember you ARE calling a webservice, you only get what the webservice
provides: if the webservice only provides a method that returns you whole DataSet, you can do nothing about it. Show quote "Chris" <Ch***@discussions.microsoft.com> wrote in message news:E2F9DBB2-3A32-4659-80F8-E41C81DCFA13@microsoft.com... > Hi, > I am populating a dataset from a webservice. One one page of my app I need > to get only the first 5 rows from the dataset to pupulate a datagrid and on > another page I then will display all the rows from that dataset in a grid. Is > it possible to select a specific amount of rows from the dataset? Please > don't tell me to use the TOP in a select statement. Remember I am calling a > webservice. > > Thanks If you are receiving the entire dataset, you can store it in a sesison
variable, and use it on your second page. Regards, Deepak [I Code, therefore I am] Show quote "Norman Yuan" wrote: > Yes, remember you ARE calling a webservice, you only get what the webservice > provides: if the webservice only provides a method that returns you whole > DataSet, you can do nothing about it. > > "Chris" <Ch***@discussions.microsoft.com> wrote in message > news:E2F9DBB2-3A32-4659-80F8-E41C81DCFA13@microsoft.com... > > Hi, > > I am populating a dataset from a webservice. One one page of my app I need > > to get only the first 5 rows from the dataset to pupulate a datagrid and > on > > another page I then will display all the rows from that dataset in a grid. > Is > > it possible to select a specific amount of rows from the dataset? Please > > don't tell me to use the TOP in a select statement. Remember I am calling > a > > webservice. > > > > Thanks > > > That's not what the question was.
You can just create a separate DataTable that contains the first 5 rows of the entire datatable in the dataset. Show quote "Norman Yuan" <nob***@nowhere.no> wrote in message news:eQfq2jZ3EHA.2404@TK2MSFTNGP14.phx.gbl... > Yes, remember you ARE calling a webservice, you only get what the > webservice > provides: if the webservice only provides a method that returns you whole > DataSet, you can do nothing about it. > > "Chris" <Ch***@discussions.microsoft.com> wrote in message > news:E2F9DBB2-3A32-4659-80F8-E41C81DCFA13@microsoft.com... >> Hi, >> I am populating a dataset from a webservice. One one page of my app I >> need >> to get only the first 5 rows from the dataset to pupulate a datagrid and > on >> another page I then will display all the rows from that dataset in a >> grid. > Is >> it possible to select a specific amount of rows from the dataset? Please >> don't tell me to use the TOP in a select statement. Remember I am calling > a >> webservice. >> >> Thanks > > Do you really think this is a good way to go? You already have the dataset
and all the data you need is contained therein. Creating another DataTable will unnecessarily increase resource utilization and provide 0 value - at least in the sense that you can get to the same place without creating another table. If he wants to update from that datatable, he'll have to dance around rowstate if he creates another - again not a big deal but totally unnecessary. -- Show quoteW.G. Ryan MVP (Windows Embedded) TiBA Solutions www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com "Scott M." <s-mar@nospam.nospam> wrote in message news:eiT3UmZ3EHA.2156@TK2MSFTNGP10.phx.gbl... > That's not what the question was. > > You can just create a separate DataTable that contains the first 5 rows of > the entire datatable in the dataset. > > "Norman Yuan" <nob***@nowhere.no> wrote in message > news:eQfq2jZ3EHA.2404@TK2MSFTNGP14.phx.gbl... > > Yes, remember you ARE calling a webservice, you only get what the > > webservice > > provides: if the webservice only provides a method that returns you whole > > DataSet, you can do nothing about it. > > > > "Chris" <Ch***@discussions.microsoft.com> wrote in message > > news:E2F9DBB2-3A32-4659-80F8-E41C81DCFA13@microsoft.com... > >> Hi, > >> I am populating a dataset from a webservice. One one page of my app I > >> need > >> to get only the first 5 rows from the dataset to pupulate a datagrid and > > on > >> another page I then will display all the rows from that dataset in a > >> grid. > > Is > >> it possible to select a specific amount of rows from the dataset? Please > >> don't tell me to use the TOP in a select statement. Remember I am calling > > a > >> webservice. > >> > >> Thanks > > > > > > Chris:
Once you have the dataset, you can create a DataView on any of the tables. You may want to add a DataColumn - set its Autoincrement to true and use the RowFilter to only show those 5 values. Or you can do a dataTable.Select to get to the same place. -- Show quoteW.G. Ryan MVP (Windows Embedded) TiBA Solutions www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com "Chris" <Ch***@discussions.microsoft.com> wrote in message news:E2F9DBB2-3A32-4659-80F8-E41C81DCFA13@microsoft.com... > Hi, > I am populating a dataset from a webservice. One one page of my app I need > to get only the first 5 rows from the dataset to pupulate a datagrid and on > another page I then will display all the rows from that dataset in a grid. Is > it possible to select a specific amount of rows from the dataset? Please > don't tell me to use the TOP in a select statement. Remember I am calling a > webservice. > > Thanks Yup, I agree, this is the mostest bestest suggestion.
Using a dataview, setting the proper filter criteria - binding only the first 5 rows will be real straightforward even. Let me know if you need a code sample. - Sahil Malik http://dotnetjunkies.com/weblog/sahilmalik Show quote "W.G. Ryan eMVP" <WilliamRyan@NoSpam.gmail.com> wrote in message news:OWL3e5a3EHA.2804@TK2MSFTNGP15.phx.gbl... > Chris: > > Once you have the dataset, you can create a DataView on any of the tables. > You may want to add a DataColumn - set its Autoincrement to true and use > the > RowFilter to only show those 5 values. > > Or you can do a dataTable.Select to get to the same place. > > -- > W.G. Ryan MVP (Windows Embedded) > > TiBA Solutions > www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com > "Chris" <Ch***@discussions.microsoft.com> wrote in message > news:E2F9DBB2-3A32-4659-80F8-E41C81DCFA13@microsoft.com... >> Hi, >> I am populating a dataset from a webservice. One one page of my app I >> need >> to get only the first 5 rows from the dataset to pupulate a datagrid and > on >> another page I then will display all the rows from that dataset in a >> grid. > Is >> it possible to select a specific amount of rows from the dataset? Please >> don't tell me to use the TOP in a select statement. Remember I am calling > a >> webservice. >> >> Thanks Yes please. A code sample would greatly be appreciated even where I can find
info on this. Thanks Show quote "Sahil Malik" wrote: > Yup, I agree, this is the mostest bestest suggestion. > > Using a dataview, setting the proper filter criteria - binding only the > first 5 rows will be real straightforward even. Let me know if you need a > code sample. > > - Sahil Malik > http://dotnetjunkies.com/weblog/sahilmalik > > > "W.G. Ryan eMVP" <WilliamRyan@NoSpam.gmail.com> wrote in message > news:OWL3e5a3EHA.2804@TK2MSFTNGP15.phx.gbl... > > Chris: > > > > Once you have the dataset, you can create a DataView on any of the tables. > > You may want to add a DataColumn - set its Autoincrement to true and use > > the > > RowFilter to only show those 5 values. > > > > Or you can do a dataTable.Select to get to the same place. > > > > -- > > W.G. Ryan MVP (Windows Embedded) > > > > TiBA Solutions > > www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com > > "Chris" <Ch***@discussions.microsoft.com> wrote in message > > news:E2F9DBB2-3A32-4659-80F8-E41C81DCFA13@microsoft.com... > >> Hi, > >> I am populating a dataset from a webservice. One one page of my app I > >> need > >> to get only the first 5 rows from the dataset to pupulate a datagrid and > > on > >> another page I then will display all the rows from that dataset in a > >> grid. > > Is > >> it possible to select a specific amount of rows from the dataset? Please > >> don't tell me to use the TOP in a select statement. Remember I am calling > > a > >> webservice. > >> > >> Thanks > > > Chris: here are some examples on using the RowFilter
http://www.google.com/search?q=RowFilter&domains=KnowDotNet.com&sitesearch=KnowDotNet.com I have some with using computed columns as well - when I get home I'll write you a quick mockup on how to do it. Show quote "Chris" <Ch***@discussions.microsoft.com> wrote in message news:89BF9056-3A5B-453E-B3AF-A3B706FB811C@microsoft.com... > Yes please. A code sample would greatly be appreciated even where I can find > info on this. > > Thanks > > "Sahil Malik" wrote: > > > Yup, I agree, this is the mostest bestest suggestion. > > > > Using a dataview, setting the proper filter criteria - binding only the > > first 5 rows will be real straightforward even. Let me know if you need a > > code sample. > > > > - Sahil Malik > > http://dotnetjunkies.com/weblog/sahilmalik > > > > > > "W.G. Ryan eMVP" <WilliamRyan@NoSpam.gmail.com> wrote in message > > news:OWL3e5a3EHA.2804@TK2MSFTNGP15.phx.gbl... > > > Chris: > > > > > > Once you have the dataset, you can create a DataView on any of the tables. > > > You may want to add a DataColumn - set its Autoincrement to true and use > > > the > > > RowFilter to only show those 5 values. > > > > > > Or you can do a dataTable.Select to get to the same place. > > > > > > -- > > > W.G. Ryan MVP (Windows Embedded) > > > > > > TiBA Solutions > > > www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com > > > "Chris" <Ch***@discussions.microsoft.com> wrote in message > > > news:E2F9DBB2-3A32-4659-80F8-E41C81DCFA13@microsoft.com... > > >> Hi, > > >> I am populating a dataset from a webservice. One one page of my app I > > >> need > > >> to get only the first 5 rows from the dataset to pupulate a datagrid and > > > on > > >> another page I then will display all the rows from that dataset in a > > >> grid. > > > Is > > >> it possible to select a specific amount of rows from the dataset? Please > > >> don't tell me to use the TOP in a select statement. Remember I am calling > > > a > > >> webservice. > > >> > > >> Thanks > > > > > > Thanks
Show quote "W.G. Ryan eMVP" wrote: > Chris: here are some examples on using the RowFilter > http://www.google.com/search?q=RowFilter&domains=KnowDotNet.com&sitesearch=KnowDotNet.com > > I have some with using computed columns as well - when I get home I'll write > you a quick mockup on how to do it. > > -- > W.G. Ryan, MVP > > www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com > "Chris" <Ch***@discussions.microsoft.com> wrote in message > news:89BF9056-3A5B-453E-B3AF-A3B706FB811C@microsoft.com... > > Yes please. A code sample would greatly be appreciated even where I can > find > > info on this. > > > > Thanks > > > > "Sahil Malik" wrote: > > > > > Yup, I agree, this is the mostest bestest suggestion. > > > > > > Using a dataview, setting the proper filter criteria - binding only the > > > first 5 rows will be real straightforward even. Let me know if you need > a > > > code sample. > > > > > > - Sahil Malik > > > http://dotnetjunkies.com/weblog/sahilmalik > > > > > > > > > "W.G. Ryan eMVP" <WilliamRyan@NoSpam.gmail.com> wrote in message > > > news:OWL3e5a3EHA.2804@TK2MSFTNGP15.phx.gbl... > > > > Chris: > > > > > > > > Once you have the dataset, you can create a DataView on any of the > tables. > > > > You may want to add a DataColumn - set its Autoincrement to true and > use > > > > the > > > > RowFilter to only show those 5 values. > > > > > > > > Or you can do a dataTable.Select to get to the same place. > > > > > > > > -- > > > > W.G. Ryan MVP (Windows Embedded) > > > > > > > > TiBA Solutions > > > > www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com > > > > "Chris" <Ch***@discussions.microsoft.com> wrote in message > > > > news:E2F9DBB2-3A32-4659-80F8-E41C81DCFA13@microsoft.com... > > > >> Hi, > > > >> I am populating a dataset from a webservice. One one page of my app I > > > >> need > > > >> to get only the first 5 rows from the dataset to pupulate a datagrid > and > > > > on > > > >> another page I then will display all the rows from that dataset in a > > > >> grid. > > > > Is > > > >> it possible to select a specific amount of rows from the dataset? > Please > > > >> don't tell me to use the TOP in a select statement. Remember I am > calling > > > > a > > > >> webservice. > > > >> > > > >> Thanks > > > > > > > > > > > > |
|||||||||||||||||||||||