Question
"hard" ASP.NET or SQL: how to programmatically strip first row of a datalist, or delete top row of a SqlDataSource's dataset
I'm using ASP.NET 2.0 and C#.
I'd like to do any of the following which might solve my problem:
a) programmatically hide the first row of a datalist. I've looked carefully
at this and other resources, but have been unable to translate the advice
into functional code:
http://www.codecomments.com/archive320-2005-10-657712.html
b) I'm using a quick-and-dirty SqlDataSource. It returns a DataSet, though I
can't figure out at what point in the page lifecycle this happens, or what
that DataSet is named. If I could programmatically delete the top row, that
would do what I need.
c) If I could write an inline SQL query to grab everything but the first
record, that would work, too. Note that for the purposes of being stubborn
😉 I don't want to resort to a stored procedure, which would easily solve my
problem. I'm using SQL Server 2005.
Any suggestions, preferably with code? Should be a very simple problem...
-KF
I'd like to do any of the following which might solve my problem:
a) programmatically hide the first row of a datalist. I've looked carefully
at this and other resources, but have been unable to translate the advice
into functional code:
http://www.codecomments.com/archive320-2005-10-657712.html
b) I'm using a quick-and-dirty SqlDataSource. It returns a DataSet, though I
can't figure out at what point in the page lifecycle this happens, or what
that DataSet is named. If I could programmatically delete the top row, that
would do what I need.
c) If I could write an inline SQL query to grab everything but the first
record, that would work, too. Note that for the purposes of being stubborn
😉 I don't want to resort to a stored procedure, which would easily solve my
problem. I'm using SQL Server 2005.
Any suggestions, preferably with code? Should be a very simple problem...
-KF
