Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Professional
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 17th, 2006, 11:50 PM
Authorized User
 
Join Date: Jan 2006
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hunzian78@yahoo.com
Default how to add new record as first record in dataset

Hi all,

Well, i have been stucked in a tricky problem. I want to add a new item(record) as first item(record) in dataset which is already been populated from database.

I hope that I will going to have replies very soon. Thanks in advance for your valuable replies...

Abdul Ghaffar


 
Old April 18th, 2006, 10:07 PM
Authorized User
 
Join Date: Apr 2006
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Maybe you can add a special column named colsort for sorting in DataSet.
For example, the colsort data in the the former rows is 0 and the elder is 1.
Then you can use datagridview to sort the data by colsort desc.
But be careful your memory.

:)¡¶
 Â¡Â¶Â¡Â¶ No pains, no gains.
¡¶¡¶¡¶
 
Old April 19th, 2006, 08:21 AM
Authorized User
 
Join Date: Apr 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Can create a new Dataset, add the record to th new dataset, and then merge data from the old one with preserveChanges set to true...

DataSet ds = new DataSet();
//add new row here
ds.Merge(oldDataSet, true);

 
Old April 21st, 2006, 12:02 AM
Authorized User
 
Join Date: Jan 2006
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hunzian78@yahoo.com
Default


Thanks Rumbafu for your valuable reply..... it really worked fine....

Abdul Ghaffar



 
Old April 21st, 2006, 05:23 AM
Authorized User
 
Join Date: Apr 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No prob






Similar Threads
Thread Thread Starter Forum Replies Last Post
Add record mateenmohd Access 1 October 3rd, 2006 06:53 AM
Help with Add record topshed Classic ASP Basics 6 February 7th, 2006 02:59 AM
Cannot add new record geolando Access 0 June 27th, 2005 06:23 PM
Adding a new record to a dataset Louisa VB.NET 2002/2003 Basics 1 January 14th, 2004 05:33 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.