473,785 Members | 2,327 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ObjectDataSourc e problem with return newly inserted record id

Hi,

I'm using an objectdatasourc e. The insert procedure called by the
objectdatasourc e is in a separate library file outside of the aspx and
the codebehind that is using the objectdatasourc e in question (I guess
that separate file would be called a bll).

I had originally used the parameter list method to pass the
inserted values to thie insert procedure which also gave me the
ability to add a retun parameter to access the newly created record id
(identity). I've changed to use the much easier method of using the
dataobjecttypen ame and the typename to pass the inserted values into
the procedure through an instantiation of my business object. As a
result the only parameter in the signature of the insert proc is of
the type of the business object.

This works very well. However I am no longer able to pass the newly
inserted record id back to the aspx page that called it. I could
access it in the insert proc and put it in a session variable but
this, to me, is bad practice. I tried adding another parameter to the
insert parameters list for the objectdatasourc e called newid and then
added that to the parameter list in the insert proc. I got an error
that led me to believe that the objectdatasourc e was still looking for
an insert proc that had only the business class type in its parameter
list. In other words, the second parameter does not seem to be welcome
using the typename and dataobjecttype name parameters; it's expecting
only the business object.

I'm not sure if I need a different method of passing back the new
record id or if I just did it wrong and it is possible to add a second
parameter under these circumstances. Any advice would be appreciated.

Thanks,
Fig000
Sep 6 '08 #1
0 1618

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

Similar topics

1
1663
by: Tony | last post by:
Thanks for writing back and don't laugh at what I am about to post I am new to this type of stuff....this is what I have tried and it isn't working(please note in the try section I was just trying to see if it was grabbing my variable or not any suggestions or hints would be greatly appreciated: ******** Private Sub AddArticle()
4
1948
by: olafmol | last post by:
Hello, i am wondering if there is a simple way to insert a new record into an MS Access db and read out the newly created auto-ID field. Using ASP this was rather simple, but in ASP.NET (VB) it seems to have become rather complex???? cheers, Olaf
2
2231
by: Kjetil Klaussen | last post by:
Hi, I’m having some troubles trying to bind my dataset to a GridView control through an ObjectDataSource control. The binding works fine for regular columns in my dataset, but I can’t seem to get my expression columns to show up in my GridView. Anybody knows any neat tricks to make this work? Here’s a “step-by-step” to reproduce my worries: 1. Create a new “ASP.NET web site” project
1
1618
by: Craig | last post by:
In ASP.NET 2.0 and the formview control how do you get the value of the identity field of a newly inserted record? In ASP.NET 1.1 after the new record was saved you just said intNewIdentityID = Dataset.tblMtTable.IndentityID Simple but can't seem to do it in the formview. Thanks
0
810
by: William Buchanan | last post by:
Hi What i'm trying to do should be simple (and if I was to use an SQL component it would be - but that's not the point!).... I have a DetailsView which is on a web form which is only used in insert mode (to add new records). So, the form is shown, the user enters the new details, includes an image file (using a file upload), clicks submit. Then the form is re-displayed empty ready for the next.
8
2353
by: MLH | last post by:
Here's a snippet from A97 HELP on AddNew... The record that was current before you used AddNew remains current. If you want to make the new record current, you can set the Bookmark property to the bookmark identified by the LastModified property setting. My own experience is indicating that the newly added record becomes current during the AddNew processes and REMAINS current after .Update method runs. This seems true even though the...
1
1552
by: Jamie Oglethorpe | last post by:
I have a simple prototype ASP application with a business object wrapping a data set. It contains a single data table. On my UI I have two object data sources; the first has a bound drop down list, with a description and key. The second has a bound details view showing everything except for the key. Selecting an item in the drop down list, causes the details to be shown, as intended. When I insert a new record from the details view, I...
0
228
by: shapper | last post by:
Hello, I have an ObjectDataSource with Save defined as insert method. I need return the ID of the inserted record so I can use it in my ObjectDataSource after the item has been inserted. How can I do this? This is my code:
5
2176
by: cmrchs | last post by:
Hi, I'm trying out Databinding to a Data Acces Layer using a ObjectDataSource-control The Update works fine but the Delete-method doesn't. when debugging I see that my productID-parameter is always 0 and not the ID of the selected record (which is the case when updating) How come?
0
9647
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
10356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10100
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9959
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8988
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 projectplanning, coding, testing, and deploymentwithout 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
7509
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
6744
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
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.