ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 9th, 2003, 09:00 PM
gparker gparker is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 1 gparker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Removing a Row from a Dataset

Hello All,

I am having trouble in finding out the correct way to remove a row from a dataset. I have successfully implemented editing rows and updating rows so I assume the logic is pretty similiar but i havent had any luck.

Setup
--------
Data Access Layer -:
I have data adapters setup correctly with stored procedures for the simple management of a table within sql server 2000.
Datasets are then defined from this adapter.

Business Layer -:
Reference to the dataset in the DAL.
Datagrids setup to display and control the data.


Assumed Logic
-------------------
Identify Data Key from Datagrid with Select
Remove the row from the Dataset using the Data Key
Call an to the the Dataset.


Attemped Code
---------------------
Dim row As accountsDataset.spGetAccountsRow

row = AccountsDataset1.spGetAccounts.Rows(DataGrid1.Sele ctedIndex)

AccountsDataset1.spGetAccounts.Rows.RemoveAt(DataG rid1.SelectedIndex)

handler.UpdateAccountsDataset(AccountsDataset1)


Public Sub UpdateAccountsDataset(ByVal ds As accountsDataset)
Try
accountsAdapter.Update(ds)
ds.AcceptChanges()

Catch exc As Exception
Dim msg As String
msg = "Error while updating Account."
Throw New DALException(msg, exc, ds)
End Try
End Sub


Comments
--------------
I have used a similiar approach for the inserting and updateing of rows within the dataset. I have run SQL profiler and can confirm that the stored procedure that should be run isnt actually being called at all, so the problem is definatly within the application code.

My guess is im not using the Rows.Remove syntax correctly, I have played around with other ways without much luck either.

Any help would be greatly appreciated.

Reply With Quote
  #2  
Old June 10th, 2003, 07:19 PM
James Yang James Yang is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Atlanta, Georgia
Posts: 284 James Yang User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 45 sec
Reputation Power: 7
Send a message via ICQ to James Yang
try to remove any error handling code and see if u can find any error message !!
__________________
Regards,

James Yang
.NET Developer / Network Engineer
MCSE, MCDBA, MCSA, CCNA

http://www.yellowpin.com/
http://www.opentechsupport.com/

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > Removing a Row from a Dataset


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway