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

Re: How Do I setup a RowChangedEvent in a Typed DataSet by William

William
Thu Mar 06 18:44:52 CST 2008

It seems to me I discussed this in my article posted to Developer.Com. See
the article on using the TableAdapter for Hierarchical ops.

--
__________________________________________________________________________
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)
____________________________________________________________________________________________
"Devon-S" <DevonS@discussions.microsoft.com> wrote in message
news:5F423902-C699-4A86-9AB8-2DF6757AA1D4@microsoft.com...
> 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
>
>


Re: How Do I setup a RowChangedEvent in a Typed DataSet by DevonS

DevonS
Thu Mar 06 19:44:00 CST 2008

William,

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

Devon


"William Vaughn" wrote:

> It seems to me I discussed this in my article posted to Developer.Com. See
> the article on using the TableAdapter for Hierarchical ops.
>
> --
> __________________________________________________________________________
> 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)
> ____________________________________________________________________________________________
> "Devon-S" <DevonS@discussions.microsoft.com> wrote in message
> news:5F423902-C699-4A86-9AB8-2DF6757AA1D4@microsoft.com...
> > 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
> >
> >
>

Re: How Do I setup a RowChangedEvent in a Typed DataSet by Cor

Cor
Thu Mar 06 22:57:57 CST 2008

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


Re: How Do I setup a RowChangedEvent in a Typed DataSet by Cowboy

Cowboy
Fri Mar 07 10:32:58 CST 2008

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.

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

*************************************************
| Think outside the box!
|
*************************************************
"Devon-S" <DevonS@discussions.microsoft.com> wrote in message
news:5F423902-C699-4A86-9AB8-2DF6757AA1D4@microsoft.com...
> 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
>
>



Re: How Do I setup a RowChangedEvent in a Typed DataSet by DevonS

DevonS
Fri Mar 07 11:42:00 CST 2008

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



"Cowboy (Gregory A. Beamer)" wrote:

> 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.
>
> --
> Gregory A. Beamer
> MVP, MCP: +I, SE, SD, DBA
>
> *************************************************
> | Think outside the box!
> |
> *************************************************
> "Devon-S" <DevonS@discussions.microsoft.com> wrote in message
> news:5F423902-C699-4A86-9AB8-2DF6757AA1D4@microsoft.com...
> > 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
> >
> >
>
>
>

Re: How Do I setup a RowChangedEvent in a Typed DataSet by Cowboy

Cowboy
Wed Mar 12 08:43:36 CDT 2008

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.

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

*************************************************
| Think outside the box!
|
*************************************************
"Devon-S" <DevonS@discussions.microsoft.com> wrote in message
news:BDD03C4C-2A8A-4426-AC76-A139F249B5BE@microsoft.com...
> 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
>
>
>
> "Cowboy (Gregory A. Beamer)" wrote:
>
>> 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.
>>
>> --
>> Gregory A. Beamer
>> MVP, MCP: +I, SE, SD, DBA
>>
>> *************************************************
>> | Think outside the box!
>> |
>> *************************************************
>> "Devon-S" <DevonS@discussions.microsoft.com> wrote in message
>> news:5F423902-C699-4A86-9AB8-2DF6757AA1D4@microsoft.com...
>> > 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
>> >
>> >
>>
>>
>>