Microsoft Most Valuable Professional

Chris Pietschmann

An MVP From Wisconsin



Why do we need to handle the RowUpdated event of our DataAdapter in order to reflect the ID in a Primary/Foriegn key relationship??

Why do we need to handle the RowUpdated event of our DataAdapter in order to reflect the ID in a Primary/Foriegn key relationship?? Well, anyway here is a page that tells you how to do this.

AddHandler daChargeAttendance.RowUpdated, AddressOf FeeChargeAttendanceRowUpdated

Private Sub FeeChargeRowUpdated(ByVal sender As Object, ByVal e As SqlRowUpdatedEventArgs)
     Dim oCmd As SqlCommand = New SqlCommand("SELECT @@IDENTITY", e.Command.Connection)
     e.Row("ID") = oCmd.ExecuteScalar()
     e.Row.AcceptChanges()
End Sub

http://codeproject.com/cs/database/relationaladonet.asp

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: General
Posted by crpietschmann on Monday, August 23, 2004 5:39 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Related posts

Comments are closed

About the author

I'm Chris Pietschmann, go to the About Me page to learn more about me.

Search

Sponsors

Web.Maps.VE - ASP.NET AJAX Virtual Earth Mapping Server Control

Recent comments

Disclaimer


This work is licensed under a Creative Commons Attribution 3.0 United States License, unless explicitly stated otherwise within the posted content.
© Copyright 2004 - 2008 Chris Pietschmann