Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / ADO.NET / March 2008

Tip: Looking for answers? Try searching our database.

How Do I setup a RowChangedEvent in a Typed DataSet

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Devon-S - 06 Mar 2008 21:06 GMT
Greetings,

I have a strongly typed dataset and when I write the identity column to the
database, I set it and retrieve it. This works fine.

Now I want an event to trigger for each record that is set and retrieved
from the DataSet to update the children of the DataSet with the new identity
column.

The DataSet Created two Classes for the Products Class called

    ProductsRowChangeEvent   - and -
    ProductsRowChangeEventHandler

which will probably do the trick if I knew how to use them, or could find
some documentation on these two Classes.

Any thoughts would be greatly appreciated.

-Devon
William Vaughn - 07 Mar 2008 00:44 GMT
It seems to me I discussed this in my article posted to Developer.Com. See
the article on using the TableAdapter for Hierarchical ops.

Signature

__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205  (Pacific time)
Hitchhiker’s Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________

> Greetings,
>
[quoted text clipped - 18 lines]
>
> -Devon
Devon-S - 07 Mar 2008 01:44 GMT
William,

I just read Hierarchical TableAdapter 301 and it wasn't in there. Was there
another reference?

Devon

> It seems to me I discussed this in my article posted to Developer.Com. See
> the article on using the TableAdapter for Hierarchical ops.
[quoted text clipped - 21 lines]
> >
> > -Devon
Cor Ligthert[MVP] - 07 Mar 2008 04:57 GMT
Devon,

Just use the DataSet has changes, although that is even not needed, there
will no rows be updated by a "DBDataAdapter.Update" as long as a row has no
changed rowstate.

Cor
Cowboy (Gregory A. Beamer) - 07 Mar 2008 16:32 GMT
Good starting point is the MSDN documentation. This is for DataTable:
http://msdn2.microsoft.com/en-us/library/system.data.datatable.rowchanging.aspx

There is no row changing events on the DataSet itself.

Signature

Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************

| Think outside the box!

*************************************************
> Greetings,
>
[quoted text clipped - 18 lines]
>
> -Devon
Devon-S - 07 Mar 2008 17:42 GMT
Greg,

Thanks. I also figured out how to wire up the typed dataSet Event. It is one
of those things that once ya do it, it is very simple.

TypedDataSet.DataTable.DataTableRowChanged += <at this point VS2005 bring up
the right thing and suggests you hit Tab> so you get for Products DataTable
in NorthWind DS

NorthWind.Products.ProductsRowChanged += ProductsRowChangedEventHandler(
<and at this point Visual Studio asks if you want the method made for you>)

Which then you have  

NorthWind.Products.ProductsRowChanged +=
ProductsRowChangedEventHandler(Products_ProductsRowChanged)

void Products_ProductsRowChanged(object sender ProductsRowChangedEvent e)
{
 
}

Then I tested the code it works just like you would think. When something
changes it passes the changes to this event and you can access the row with
e.Row.

Thanks for leading me towards it...

Devon

> Good starting point is the MSDN documentation. This is for DataTable:
> http://msdn2.microsoft.com/en-us/library/system.data.datatable.rowchanging.aspx
[quoted text clipped - 26 lines]
> >
> > -Devon
Cowboy (Gregory A. Beamer) - 12 Mar 2008 14:43 GMT
Glad I could point in the right direction. I assume this is either in
library code or your page events. If you ever directly alter the DataSet
(not necessary in 2.0 and later as you can extend in your own class, make
sure you document, as someone might go and regen the DataSet if there is a
schema change and blow your required bits out of the water.

Signature

Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************

| Think outside the box!

*************************************************
> Greg,
>
[quoted text clipped - 63 lines]
>> >
>> > -Devon

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.