473,805 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Datagridview - Writing Journal Transactions for a Datagridview

I would like to write transaction activity to a journal table, specifying
Add, Update, or Delete and some information regarding each transaction when a
user works in a datagridview.

I have tried:

Dim deletedChildRec ords As dsVersaPress.Ro utingDataTable = _

CType(DsVersaPr ess.Routing.Get Changes(Data.Da taRowState.Dele ted),
dsVersaPress.Ro utingDataTable)

Dim newChildRecords As dsVersaPress.Ro utingDataTable = _
CType(DsVersaPr ess.Routing.Get Changes(Data.Da taRowState.Adde d),
dsVersaPress.Ro utingDataTable)

Dim modifiedChildRe cords As dsVersaPress.Ro utingDataTable = _

CType(DsVersaPr ess.Routing.Get Changes(Data.Da taRowState.Modi fied),
dsVersaPress.Ro utingDataTable)

Try
If deletedChildRec ords IsNot Nothing Then
Dim hCount As Integer
Dim hOperation As String
Dim hOperDesc As String
Dim hDeleteRecCount As Integer = deletedChildRec ords.Count
For hCount = 0 To hDeleteRecCount - 1
hItemNo = deletedChildRec ords.Rows(hCoun t)("Operation" )
hOperation = deletedChildRec ords.Rows(hCoun t)("Operation" )
hOperDesc = deletedChildRec ords.Rows(hCoun t)("OperDesc")
Next

RoutingTableAda pter.Update(del etedChildRecord s)

End If

If newChildRecords IsNot Nothing Then

Dim hNewRecCount As Integer = newChildRecords .Count
RoutingTableAda pter.Update(new ChildRecords)

End If

If modifiedChildRe cords IsNot Nothing Then

Dim hModifiedRecCou nt As Integer = modifiedChildRe cords.Count
RoutingTableAda pter.Update(mod ifiedChildRecor ds)
End If

DsVersaPress.Ro uting.AcceptCha nges()

Catch ex As Exception
MessageBox.Show ("An error occurred during the update process")

' Add code to handle error here.

Finally
If deletedChildRec ords IsNot Nothing Then
deletedChildRec ords.Dispose()
End If

If newChildRecords IsNot Nothing Then
newChildRecords .Dispose()
End If

If modifiedChildRe cords IsNot Nothing Then
modifiedChildRe cords.Dispose()
End If

End Try

This isolates the Insert, Delete, and Update tranactions ; but I can not
access deletedChildRec ords rows and individual fields. Is there a way to do
this?

Nov 1 '06 #1
0 1079

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

48
8519
by: Joseph | last post by:
Hi I'm writing a commercial program which must be reliable. It has to do some basic reading and writing to and from files on the hard disk, and also to a floppy. I have foreseen a potential problem. The program may crash unexpectedly while writing to the file. If so, my program should detect this during startup, and then (during startup) probably delete the data added to the file and redo the writing operation.
0
415
by: Mark Carew | last post by:
Hi, I'm writing a winform app (as practice) that has as one of its features a button that reads an xml file to a datagridview. No matter what I do I get two columns instead of one. The "first column", I retrieve and place the text "Holy Cat" in its header text. This column contains no data from the xml file. The second column contains the correct data from the xml file.
2
4577
by: Ye Li | last post by:
I have two windows with datagridview control type in one form. I want to move multiple rows from one datagridview to another datagridview. My code is as follows: private void btn_Forward_Click(object sender, EventArgs e) { int movedItemCount = dg_QuestionSource.SelectedRows.Count; for (int i = 0; i < movedItemCount; i++) {
0
1755
by: Sam Flywheel | last post by:
Hello, all: I am pleased to announce that the MySQL Journal is moving forward. During the past two weeks, I've been discussing the journal with MySQL AB, and the plan that's been devised benefits all involved, including authors, readers, the community, and MySQL AB.  Let me outline how the journal will operate: * The name of the magazine is Tabula: The Journal of MySQL Development.
20
2036
by: Vincent Delporte | last post by:
Hello I'm about to write a prototype for a business application, but since this my first real web application, I'm looking for a good book or article that sums up the different issues web developers will encounter when coming from the world of dedicated applications (VB, Delphi, etc.) I'm thinking of issues specific to web apps like the statelessness of HTTP, dealing with the back button, etc.
4
11691
by: Martin Arvidsson | last post by:
Hi! I have used the SqlCommand and DataReader to read data to a DataSet This dataset is the used to set the properties; DataMember and DataSource of the DataGridView. Now what i want to do is to go to a specific row of the DataGridView. I have tried to use a BindingSource to find the value and the issue a position, but it doesn't work
2
9888
by: Cheryl | last post by:
Hi! I have a datagridview that create views for a dynamic dataset. Now I would like to put the whole datagridview to a crystal report? Any ideas to do this? Thanks!
0
1199
by: Tony K | last post by:
I have a DataGridView that I NEED to display the data that is scanned with a barcode. The columns are: Product Number Description Location Units On Hand Untis Scanned Min On Hand Max On Hand All columns are retrieved from the database except Units Scanned. That is calculated by the # of times the operator scans a barcode.
0
1278
by: tavares | last post by:
----------------------------------------------------------------------------------------------------------------------------------------- (Apologies for cross-posting) International Journal of Imaging (IJI) http://www.ceser.res.in/iji.html ISSN 0974-0627 We would appreciate if you could distribute this information by your
0
9718
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10363
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7649
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5544
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4327
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.