Re: How to fill dataset with just one row at a time?

From: Eric Marvets (ericm_at_bangproject.com)
Date: 05/22/04


Date: Fri, 21 May 2004 21:37:38 -0400

If you use a stored proc or a parameterized query, you could pass in a
parameter to the SelectCommand.

If you do not know the primary keys in which to query for a single item at a
time, you can use a query like 'select top 1 .....where ID >
@lastIDRetrieved order by ID' using 0 as your starting value for
@lastIDRetreived.

-- 
Eric Marvets
Principal Consultant
the bang project
<shameless self promotion>
Email sales@bangproject.com for Information on Our Architecture and
Mentoring Services
</shameless self promotion>
"IMRAN SAROIA" <imransaroia2000@hotmail.com> wrote in message
news:evvl$XnPEHA.3012@TK2MSFTNGP09.phx.gbl...
> Hi!
>
> I want to select specific row from Database in Select
> Query. Can any one adivse?
>
> E.g., in selection criteria I want to mention row to retrieve.
> Are there any alternatives. I donot want to use postion property.
> I want to fill Dataset with just one row at a time.
>
> Please adivse!
>
> Regards
>
> Imran
>
>


Relevant Pages

  • Re: Time out
    ... The above procedure will return a data set in one second. ... The difference in speed could be in Sql Server: The parameterized query is optimized once and then stored in the procedure cache, so that every time you send the same query, even though the values of the parameters are different, it follows the same strategy. ... On the other hand, the non-parameterized version is optimized every time, which will be a little less efficient, but will always choose the best index according to the current index statistics. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: ASP.NET Dynamic Gridview Question
    ... SelectCommand to the current select string. ... clause but in this case I need to change the entire query. ... execute and display the data on the screen in a gridview. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: escape the and " chars to insert them onto an Access database
    ... using a parameterized query, and then just set the value of the parameter to ... Syntax error in query expression ... Object& executeResult)> at System.Data.OleDb.OleDbCommand.ExecuteCommandText ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: ASP.NET Dynamic Gridview Question
    ... When looking at it for the sqlDataSource it ... clause but in this case I need to change the entire query. ... changing the SelectCommand, this will do what you want, it uses the syntax ... execute and display the data on the screen in a gridview. ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: SqlDataSource: Changing SelectCommand property before processed
    ... I am implementing an SQL repository component. ... I would like to update the SelectCommand and SelectParameters ... repository, find the requested query template, build the text of the query ... public class SqlRepositoryDataSource: ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)