Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
ASP .Net
ASP .Net Datagrid Control
How to implement delete with DataView?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Yan-Hong Huang[MSFT], post: 4258440"] Hello Siegfried, Please refer to [URL]http://msdn.microsoft.com/library/en-us/vbcon/html/vbtskworkingwithrecordsindataview.asp?frame=true[/URL] for how to work with records in dataview. Hope it helps. Best regards, Yanhong Huang Microsoft Online Partner Support Get Secure! - [URL="http://www.microsoft.com/security"]www.microsoft.com/security[/URL] This posting is provided "AS IS" with no warranties, and confers no rights. -------------------- !From: "Siegfried Heintze" <sieg_heintze@yahoo.com> !Newsgroups: microsoft.public.dotnet.framework.aspnet.datagridcontrol !Subject: How to implement delete with DataView? !Lines: 43 !X-Priority: 3 !X-MSMail-Priority: Normal !X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 !X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 !Message-ID: <4xURa.90683$Ph3.11041@sccrnsc04> !NNTP-Posting-Host: 12.203.244.128 !X-Complaints-To: [email]abuse@comcast.net[/email] !X-Trace: sccrnsc04 1058542784 12.203.244.128 (Fri, 18 Jul 2003 15:39:44 GMT) !NNTP-Posting-Date: Fri, 18 Jul 2003 15:39:44 GMT !Organization: Comcast Online !Date: Fri, 18 Jul 2003 15:39:44 GMT !Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!newsfeed.icl.net! newsfeed.fjserv.net!nntp.theplanet.net!inewsm1.nntp.theplanet.net!zen.net.uk!in.100proofnews.com!in.100proofnews.com! elnk-atl-nf1!newsfeed.earthlink.net!prodigy.com!wn14feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com! sccrnsc04.POSTED!not-for-mail !Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet.datagridcontrol:5748 !X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.datagridcontrol ! !I have a datagrid bound to a dataview which is connected to a dataset which !is bound to MSAccess. ! !The following code deletes a record, but not the one for which I click the !delete link. I think this is because the data rows are in a different order !because of the data view. I think I have to translate the row number I'm !receiving. How do I do this? ! !Incidently, is there an easier way to delete a record? I was hoping there !was a simple function I could call in the dataset instead of having to !populate the parameters of a stored procedure or prepared statement. !Thanks, ! Siegfried ! ! Private Sub dgAssertions_DeleteCommand(ByVal source As Object, _ ! ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) _ ! Handles dgAssertions.DeleteCommand ! Dim index As Integer ! index = e.Item.ItemIndex ! rebind() ! ' Add code to delete data from data source. ! Dim dr As dsAssertions.AssertionsRow = !DsAssertions1.Assertions.Rows(index) ! 'DsAssertions1.Assertions.Rows.RemoveAt(index) ! daAssertions.DeleteCommand.Parameters(0).Value = dr.nAssertion ! daAssertions.DeleteCommand.Parameters(1).Value = dr.ridCase ! daAssertions.DeleteCommand.Parameters(2).Value = dr.A ! daAssertions.DeleteCommand.Parameters(3).Value = dr.A ! daAssertions.DeleteCommand.Parameters(4).Value = dr.B ! daAssertions.DeleteCommand.Parameters(5).Value = dr.B ! daAssertions.DeleteCommand.Parameters(6).Value = dr.C ! daAssertions.DeleteCommand.Parameters(7).Value = dr.C ! daAssertions.DeleteCommand.Parameters(8).Value = dr.D ! daAssertions.DeleteCommand.Parameters(9).Value = dr.D ! daAssertions.DeleteCommand.Parameters(10).Value = dr.E ! daAssertions.DeleteCommand.Parameters(11).Value = dr.E ! daAssertions.DeleteCommand.Connection.Open() ! daAssertions.DeleteCommand.ExecuteScalar() ! rebind() ! End Sub ! ! ! ! [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
ASP .Net
ASP .Net Datagrid Control
How to implement delete with DataView?
Top