Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 15th, 2006, 04:08 PM
Friend of Wrox
 
Join Date: Oct 2005
Posts: 173
Thanks: 0
Thanked 2 Times in 1 Post
Default

Thanks for the clarification... oh man I need to start digesting a few more of these Wrox books!

Ta
Rit
 
Old February 15th, 2006, 04:21 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

This sounds like an ideal moment to plug my new book: ASP.NET 2.0 Instant Results. ;)

In this book, you'll find twelve complete working applications (a Photo Album, a Web Shop, a Bug Tracking application and more) that show you how to accomplish more complex tasks with ASP.NET 2.0. Instead of providing just little code snippets, the book provides an architectural overview of each application, and then digs deep into its code.

The book is scheduled for release in March. You can find it on Aamazon and on this Wrox site.

<end of plug /> ;)

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Vision Of A Kiss by The B-52's (Track 8 from the album: Good Stuff) What's This?
 
Old February 16th, 2006, 05:07 AM
Friend of Wrox
 
Join Date: Oct 2005
Posts: 173
Thanks: 0
Thanked 2 Times in 1 Post
Default

Brilliant thanks Imar, I will definately be a buyer.

Rit
 
Old May 14th, 2006, 11:35 AM
Registered User
 
Join Date: May 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello,

For the people who are working with the ObjectDataSource-control, you can simply catch a return value in the inserted event of the ObjectDataSource.

This is the code for the inserted event.

    protected void ObjectDataSource1_Inserted(object sender, ObjectDataSourceStatusEventArgs e)
    {
        int retvalue = Convert.ToInt32(e.ReturnValue);
    }

For the insert-method in the ObjectDataSource i used code like this

    public int InsertBook(string BookName)
    {
        int valuetoreturn;

        // Place your insert code here. And assign the i.e. the primary key of the inserted record to valuetoreturn

        return valuetoreturn;
    }

No <asp:parameter .../> is needed to catch the return value
 
Old December 22nd, 2006, 04:55 PM
Registered User
 
Join Date: Dec 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ould you please post an example of how you have this working with Object DataSource, I can't get it to work.


Quote:
quote:Originally posted by Jurgen
 Hello,

For the people who are working with the ObjectDataSource-control, you can simply catch a return value in the inserted event of the ObjectDataSource.

This is the code for the inserted event.

    protected void ObjectDataSource1_Inserted(object sender, ObjectDataSourceStatusEventArgs e)
    {
        int retvalue = Convert.ToInt32(e.ReturnValue);
    }

For the insert-method in the ObjectDataSource i used code like this

    public int InsertBook(string BookName)
    {
        int valuetoreturn;

        // Place your insert code here. And assign the i.e. the primary key of the inserted record to valuetoreturn

        return valuetoreturn;
    }

No <asp:parameter .../> is needed to catch the return value
 
Old January 27th, 2007, 12:04 PM
Registered User
 
Join Date: Dec 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by Jurgen
 Hello,

For the people who are working with the ObjectDataSource-control, you can simply catch a return value in the inserted event of the ObjectDataSource.

This is the code for the inserted event.

    protected void ObjectDataSource1_Inserted(object sender, ObjectDataSourceStatusEventArgs e)
    {
        int retvalue = Convert.ToInt32(e.ReturnValue);
    }

For the insert-method in the ObjectDataSource i used code like this

    public int InsertBook(string BookName)
    {
        int valuetoreturn;

        // Place your insert code here. And assign the i.e. the primary key of the inserted record to valuetoreturn

        return valuetoreturn;
    }

No <asp:parameter .../> is needed to catch the return value





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Edit record right after it was Inserted? aladov ASP.NET 2.0 Professional 4 December 11th, 2007 03:18 PM
Jumping to specific record in FormView based on ID peter0480 ASP.NET 2.0 Basics 5 June 18th, 2007 04:37 AM
How to get last inserted record in a table?? dayaananthanm SQL Server 2005 6 June 11th, 2007 09:15 PM
Record is Inserted Twice donevco Access 1 February 27th, 2007 12:28 PM
Last record inserted ID ADAC Programming VB Databases Basics 1 June 5th, 2006 02:41 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.